For performance reason, Sandy offers a class which wraps the native Math.cos and Math.sin functions for some precomputed ones.
While it is much faster, it has some limitations :
Matrix4.USE_FAST_MATH = false;
Code example to illustrate the problem:
package { import flash.display.Sprite; import flash.events.*; import sandy.core.Scene3D; import sandy.core.data.*; import sandy.core.scenegraph.*; import sandy.materials.*; import sandy.materials.attributes.*; import sandy.primitive.*; public class TestBug extends Sprite { private var scene:Scene3D; private var camera:Camera3D; private var sphere:Sphere; public function TestBug() { // We create the camera camera = new Camera3D( 300, 300 ); camera.z = -200; //Matrix4.USE_FAST_MATH = false; // We create the "group" that is the tree of all the visible objects var root:Group = createScene(); // We create a Scene and we add the camera and the objects tree scene = new Scene3D( "scene", this, camera, root ); // Listen to the heart beat and render the scene addEventListener( Event.ENTER_FRAME, enterFrameHandler ); } // Create the scene graph based on the root Group of the scene private function createScene():Group { // Create the root Group var g:Group = new Group(); // Create a sphere so we have something to show sphere = new Sphere("sphere", 50,20,20); // We need to add the cube to the group g.addChild( sphere ); return g; } // The Event.ENTER_FRAME event handler tells the world to render private function enterFrameHandler( event : Event ) : void { sphere.pan += 10; sphere.roll += 10; scene.render(); } } }