gamnit: 3 Euler rotation angles for actors
[nit.git] / contrib / model_viewer / src / globe.nit
index 5ad0407..a5a9a62 100644 (file)
@@ -63,13 +63,13 @@ class GlobeModel
        redef fun load
        do
                leaves.add new LeafModel(
-                       new Mesh.uv_sphere(1.0, 2*n_parallels, n_parallels),
+                       new UVSphere(1.0, 2*n_parallels, n_parallels),
                        new GlobeMaterial.surface)
                leaves.add new LeafModel(
-                       new Mesh.uv_sphere(1.1, 2*n_parallels, n_parallels),
+                       new UVSphere(1.1, 2*n_parallels, n_parallels),
                        new GlobeMaterial.clouds)
                leaves.add new LeafModel(
-                       new Mesh.uv_sphere(1.2, 2*n_parallels, n_parallels),
+                       new UVSphere(1.2, 2*n_parallels, n_parallels),
                        new GlobeMaterial.atmo)
        end
 end
@@ -148,7 +148,7 @@ class GlobeMaterial
 
                # Set uniforms
                program.scale.uniform 1.0
-               program.rotation.uniform new Matrix.rotation(actor.rotation, 0.0, 1.0, 0.0)
+               program.rotation.uniform new Matrix.gamnit_euler_rotation(actor.pitch, actor.yaw, actor.roll)
                program.translation.uniform(actor.center.x, -actor.center.y, actor.center.z, 0.0)
                program.color.uniform(color[0], color[1], color[2], color[3])
                program.is_surface.uniform is_surface