ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

seems rotation bugs #231

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an object, such as a sphere.
2. let sphere.rotationZ=30;
3. put sphere.rotationY++ in onRenderTick function

What is the expected output? What do you see instead?
The sphere should rotate around the Y axis, but it rotate around its own Y 
axis

What version of the product are you using? On what operating system?
2.1.920

Please provide any additional information below.
here is the test code:

package {
  import flash.events.Event;

  import org.papervision3d.objects.primitives.Sphere;
  import org.papervision3d.view.BasicView;

  public class BasicViewExample extends BasicView
  {
    private var sphere:Sphere;
    public function BasicViewExample()
    {
      stage.frameRate = 40;

      sphere = new Sphere();
      scene.addChild(sphere);

      startRendering();
      sphere.rotationX=30;
    }

    override protected function onRenderTick(e:Event=null):void
    {

      sphere.rotationY++;
      super.onRenderTick();
    }
  }
}

Original issue reported on code.google.com by jiato...@gmail.com on 20 Oct 2009 at 11:21

GoogleCodeExporter commented 9 years ago
This is normal behavior. You have rotated the sphere by 30 degrees on the Z 
axis, but
that doesnt mean the Y axis stays where it is. It moves along with the rotation 
on Z.
When rotating around Z, the up,down,left,right parts of the object move too.

To achieve what you are after, you can do localRotationZ = 30 and rotationY++, 
or
just place the sphere into a DO3D, rotate the sphere on Z, and then rotate the 
DO3D on Y.

Original comment by emronisan@gmail.com on 23 Apr 2010 at 10:49