Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Sun Oct 22, 2017 12:40 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Oct 28, 2008 10:32 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I need to get the world position/rotation of a vector accoding another vector.
This is the same than multiply the two vectors? If so, how can I do that multiplication?


Top
 Profile  
 
PostPosted: Wed Oct 29, 2008 8:31 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Not sure to understand what you mean by "according another vector" ... ?


Top
 Profile  
 
PostPosted: Wed Oct 29, 2008 11:02 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok, long explanation:

The cal3D models have position(3 float) and rotation(3 float) as ODE elements.
Inside a cal3D model, with a cal3D function, I can get the position(3 float) and rotation (1 quaternion) for a certain bone X at a certain time.

But the values of the bone are relative to the model.
I need to get the world values, not relative, so i guess I have to multiply the initial vector(of the model) by the pos+quaternion of the bone.
It's that correct? If so, How can i do that?


Top
 Profile  
 
PostPosted: Thu Oct 30, 2008 8:33 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Well well well ... any math skill here ? Someone ? :)


Top
 Profile  
 
PostPosted: Sat Nov 01, 2008 5:22 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

You have: ModelPosA as 3 float, and EModelRotA as 3 float wich are absolut.
You have: BonePosR as 3 float and QBoneRotR as 1 quaternion wich are relative to the Model.

You need BonePosA and BoneRotA wich are absolut (world) pos and rot of your bone.

Hope i'm right.

I don't easly deal with quaternion, it's probably bad, but ...
Use ode dQtoR to convert your quaternion to a rotation matrix.

You will have BoneRotR as rotation matrix.

You can use ode dRFromEulerAngles to get ModelRotA as Rotation Matrix form 3 float wich are euler angles.

At this time:
Orientation of your bone is the multiplication of both rotation matrix:

BoneRotA = BoneRotR * ModelRotA // Be carrefull order is important from my memory this is the right order but i may be wrong

BonePosA = ModelPosA + ModeRotA * BonePosR // You will have Bone Absolut position

Ode dGetEulerAngleFromRot return euler angle (as 3 float) from your BoneRotA for example.

It's probably better to make some tests using Maxima or an other math program.

Secondly:
Quaternion seem's to do the same thing as rotation matrix.
So it's probably more efficient to get quaternion of your model and multiply your quaternion (absolut and local) than using rotation matrix.


Have a nice day
Ouille.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group