Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Changed odd? to even? in indices selection. Alot more models are load…
Browse files Browse the repository at this point in the history
…able now
  • Loading branch information
dorsath committed Jul 10, 2012
1 parent e82de9a commit 3d64a3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/collada.rb
Expand Up @@ -34,7 +34,8 @@ def geometries
end

def indices(url)
doc.css("#{url} triangles p").first.content.split(/\s+/).select.with_index { |p, i| i.odd? }.map(&:to_i)
indices_count = doc.css("#{url} triangles").first[:count].to_i * 3
doc.css("#{url} triangles p").first.content.split(/\s+/).select.with_index { |p, i| i.even? }.map(&:to_i)[(0..indices_count)]
end

def vertices(url)
Expand Down

0 comments on commit 3d64a3b

Please sign in to comment.