Permalink
Browse files

Changed odd? to even? in indices selection. Alot more models are load…

…able now
  • Loading branch information...
1 parent e82de9a commit 3d64a3bf50317d5a0d1dab9df49acb25ed177eba @dorsath dorsath committed Jul 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/collada.rb
View
@@ -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)

0 comments on commit 3d64a3b

Please sign in to comment.