Broken support for textures, trying to switch to opengl-bindings gem

This commit is contained in:
2018-03-18 22:38:16 -05:00
parent 3e9f1c47e7
commit 62364b2145
7 changed files with 105 additions and 39 deletions

View File

@@ -10,6 +10,12 @@ class IMICFPS
@textures = []
@normals = []
@faces = []
# Faces array packs everything:
# vertex = index[0]
# uv = index[1]
# normal = index[2]
# material = index[3]
end
def flattened_vertices
@@ -21,7 +27,7 @@ class IMICFPS
list << v.x
list << v.y
list << v.z
# list << v.weight
list << v.weight
end
end
@@ -71,6 +77,23 @@ class IMICFPS
return @normals_list
end
def flattened_textures
unless @textures_list
list = []
@faces.each do |face|
[face[1]].each do |v|
next unless v
list << v.x
list << v.y
end
end
@textures_list = list
end
return @textures_list
end
end
end
end