Cuneyt Ozdas Forum
Cuneyt Ozdas Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 English - General
 Software Support
 Quaternians??
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

charley_c
Starting Member

USA
2 Posts

Posted - 03/02/2004 :  06:51:47  Show Profile
Can you go into greater depth on quaternians Cuneyt? I am so close to understanding these, but I am missing something. How can I accuratly manipulate an objects rotation in 3d space? When I make a quat (quat 45 [0,0,1]) it wants to rotate my object from the world origin rather then its own. I have looked extensivly at your ball rolling tut and I am sure the answer is in there, but I can't see it. I have tried adding my desired axis of rotation to the objects current location

a = obj.pos
b = obj.pos + [0,0,1]

then used the dif and len equasions from your tut and got made a vector from that, but this gave me the same result as my first attempt (quat 45 [0,0,1]) ) and rotates from the world origin. Can you help me?

charley_c
Starting Member

USA
2 Posts

Posted - 03/02/2004 :  06:55:35  Show Profile
Still thinking about it...or do I need to create the axis of rotation based on the objects current direction using .dir rather then its position???...but then how do you find the correct axis relative to that?.... Well, its late, I need to sleep. Thanks for any help anyone can give me.

Edited by - charley_c on 03/02/2004 06:56:09
Go to Top of Page

Admin
Forum Admin

Turkey
649 Posts

Posted - 11/02/2004 :  19:19:25  Show Profile  Visit Admin's Homepage
Hi,
Sorry for the late reply

Have you tried using
rotate $ (angleaxis 45 [0,0,1])

That rotation is relative to the current orientation but uses the object pivot as the rotation center.

$.rotation lets you define the rotation of object absolutely but as you stated uses the world origin as the rotation center. But is turnes out t be that settings the sub (Euler) components of the rotation (i.e. $.rotation.x_rotation) uses the object pivot point as the rotation center (That's the same thign as entering Absolute:World values in Transform Type-In dialog of 3ds max: Thanks goes to ZeBoxx for this info)

So what you can try is

r = quat 45 [0,0,1]
xyz = QuatToEuler r
obj.rotation.x_rotation = xyz.x
obj.rotation.y_rotation = xyz.y
obj.rotation.z_rotation = xyz.z

I'm not sure if that's an answer to your question. Hope it's


/Cuneyt
Go to Top of Page

edouard_g
Starting Member

1 Posts

Posted - 03/11/2004 :  16:31:09  Show Profile
Hi,

I tried your suggestion and the object still only transforms about the worlds axis.

I'm trying to animate a worm gear; (axis) of rotation in the plane of rotation of the other gear. sounds too eazy, but its not it seems (I don't want to manualy key the rotations)

eD. (novice maxer)

Go to Top of Page

Admin
Forum Admin

Turkey
649 Posts

Posted - 17/11/2004 :  14:31:13  Show Profile  Visit Admin's Homepage
Weird,

r = quat 45 [0,0,1]
xyz = QuatToEuler r
obj.rotation.x_rotation = xyz.x
obj.rotation.y_rotation = xyz.y
obj.rotation.z_rotation = xyz.z


works perfectly here.

But for the worm gear, I think you can do it without going into quaternions at all since the gears can rotate only in one axis. So I'd suggest you to use someting like

obj_driven.rotation.A = k*obj_driver.rotation.B

A and B are one of x,y,z (depending on your setup) and k is the ratio for the gear setup.

/Cuneyt
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Cuneyt Ozdas Forum © 2000 - 2003 Cuneyt Ozdas Go To Top Of Page
This page was generated in 0.06 seconds. Snitz Forums 2000