mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Model is now able to push data into VBO
This commit is contained in:
@@ -42,18 +42,25 @@ class IMICFPS
|
||||
face.vertices = []
|
||||
face.uvs = []
|
||||
face.normals = []
|
||||
face.colors = []
|
||||
face.material = material
|
||||
face.smoothing= @smoothing
|
||||
|
||||
mat = face.material.diffuse
|
||||
color = Vector.new(mat.red, mat.green, mat.blue)
|
||||
|
||||
verts.each_with_index do |v, index|
|
||||
|
||||
if uvs.first != ""
|
||||
face.vertices << @vertices[Integer(v)-1]
|
||||
face.uvs << @uvs[Integer(uvs[index])-1]
|
||||
face.normals << @normals[Integer(norms[index])-1]
|
||||
face.colors << color
|
||||
else
|
||||
face.vertices << @vertices[Integer(v)-1]
|
||||
face.uvs << nil
|
||||
face.normals << @normals[Integer(norms[index])-1]
|
||||
face.colors << color
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user