diff --git a/lib/mittsu/core/geometry.rb b/lib/mittsu/core/geometry.rb index 42d4e263..a1ba747e 100644 --- a/lib/mittsu/core/geometry.rb +++ b/lib/mittsu/core/geometry.rb @@ -469,7 +469,7 @@ def to_json end vertices = [] @vertices.each do |vert| - vertices << vertex.x << vertex.y << vertex.z + vertices << vert.x << vert.y << vert.z end faces = [] normals = [] @@ -507,7 +507,7 @@ def to_json faces << get_uv_index(face_vertex_uvs[2], uvs_hash, uvs) end if has_face_normal - faces << get_normal_index(face.normal) + faces << get_normal_index(face.normal, normals_hash, normals) end if has_face_vertex_normal vertex_normals = face.vertex_normals diff --git a/lib/mittsu/core/object_3d.rb b/lib/mittsu/core/object_3d.rb index ceadfdc0..fb1a5bdd 100644 --- a/lib/mittsu/core/object_3d.rb +++ b/lib/mittsu/core/object_3d.rb @@ -357,7 +357,7 @@ def jsonify if !self.children.empty? data[:children] = @children.map do |child| - child.jsonify + child.to_json end end