So to explain what I want to do:
I have a scene, I put in it a rootNode which is a displayObject3D representing a collada fille created from a 3ds file.
I want that when the user clicks on 'M', the camera rotates arround the object (arround the 3d model).
FIRST IDEA:
My first idea was to do:
rootNode.pan(5);
But the problem is that rootNode rotates attound its ORIGIN which doesn't match with ITS center. so it dosn't show a rotation of a camera arround the object but a rotation of rootNode arround its origin. I know that rotating the rootNode is a Fake of rotation the camera arround the object , it is a trick. SO If i can rotate the rootNode arround its CENTER it will be perfect.
THE SECOND IDEA: some people gave
me this solution:
private function moveCamera():void
{
var dist:Number = camera.distanceTo(rootNode);
camera.moveForward(dist);
camera.pan(5);
camera.moveForward(-dist);
}
But is is the same problem, the distance between the camera and the rootNode is calculated not to the center of the rootNode but its ORIGIN, so the movement is horrible. In addition to that when i press many times on the 'm' key, the camera became far and far from the rootNode.
SO I want to use my first idea, the only problem is HOW to make a rotation on the rootNode arround ITS center instead of its origin.
DO YOU HAVE ANY IDEA ?
PS: which code do you want exactly
?
Ne gardez plus qu'une seule adresse mail !
Copiez vos mails vers Yahoo! Mail
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org