« Return to Thread: Re: Rotation around Arbitrary axis addition to DisplayObject3D

Re: RE : Re: RE : RE : Re: Rotation around Arbitrary axis addition to DisplayObject3D

by Dustin Sparks :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
calculateMultiply is part of your Mesh3D class. You should already have it. Make sure that its in your Matrix3D class, and also make sure that your DisplayObject3D class is importing the Mesh3D class. It might help if you grab the most recent SVN.

Also, i havent tried it with a collada file with more than 1 object in it yet. (Moon, can you send me your collada file so i can test that out? I dont have any that act as you describe).

In the example i gave, the camera rotates around the earth object like you said. I dont see why it wouldnt work if you tell it to rotate around the nested object.
===============

From the way it sounds.. you want to rotate the object around a central point, but the central point isnt an object?  I overlooked this in my code, but the way you can do it is fairly simple.

Modify the rotationArbitrary method in your DisplayObject3D class to be

rotateArbitrary( angle:Number, axis:Number3D = null, targetObject:* = null)

now... instead of sending the object, or not sending anything at all as your targetObject, you'll need to send the Number3D representing the center of your object...

once you change that... try these:

rootNode.rotationArbitrary(.05, new Number3D(0,1,0), new Number3D(x,y,z));

x being the X coordinate that you want to be the new center.
y being the Y coordinate of your new center.
z being the Z coordinate of your new center.

Note that rotations can be in any direction based on the first Number3D;
in this example its a rotation around the Y axis (0,1,0). You dont have to use integers. You can rotate it on any axis ( 2.1, 0.45, 5)  if you want.



========== everyone...
test this out and let me know if it works, i've tried a few tests, but I havent tried with multiple nested objects, and I havent been able to test it many times.

==========

I also want to add an offset value to the function, which would allow you to specify a rotation distance. Currently, it just rotates from where its placed in the file.

On 6/26/07, Peter Kapelyan <flashnine@... > wrote:
Ok i thought of a way - If you send me all the files I can do it for you but it will be a simple hack...not very hard.
This is the idea

Make a node
Always look at node with camera.
Always make your object (DAE?) look at node also.
 
Now , when you move your camera around - it will rotate the node.
Since object is always looking at node it will rotate too (but so will camera on an axis so might have to lock it afterwards)
 
So finally just use MYDAE.moveBackward to move it away from the node (depending on rotation- already done lol)
 
So it is very easy and could work and could try to get it to wrk for you if you want-but would rather get it to work for you than start from scratch file....so you can still send file and I will try - maybe tommorow...but I am done thinking! :)
Sorry but today will be very busy with my son (his last day of school-half day) and have tonight booked for some other projects (away3d)...
 
-Pete

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org




--
Dustin Sparks
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

 « Return to Thread: Re: Rotation around Arbitrary axis addition to DisplayObject3D