.B3D Format Question

Blitz3D Forums/Blitz3D Programming/.B3D Format Question

jfk EO-11110(Posted 2003) [#1]
Hi. Can somebody pls tell me what's the meaning of the "w_rot" Parameter in the NODE-Chunk in .B3D Files?

b3dWriteFloat( 1 ) ;rot_w
b3dWriteFloat( 0 ) ;rot_x
b3dWriteFloat( 0 ) ;rot_y
b3dWriteFloat( 0 ) ;rot_z

Is it probably a Flag for Local/Global Rotation?


jhocking(Posted 2003) [#2]
I don't know about the "w_rot" parameter specifically (since I've not looked much at the b3d file format specifications) but usually in 3D graphics W refers to texture coordinates. UVW are analogous for texture coordinates to XYZ for mesh coordinates.


mongia2(Posted 2003) [#3]
excuse my bad english
w x y z is a quaternion
sytem for rotation angle

bye bye


jfk EO-11110(Posted 2003) [#4]
thanks a lot!


Michael Reitzenstein(Posted 2003) [#5]
Ase mongia says, the B3D format uses Quaternion rotations rather than Euler angles. Quaternions are made up of a 3D vector in 4D space (or something along those lines) along with a 'remainder' rotation.


jhocking(Posted 2003) [#6]
Good to know. I'm thinking about writing a b3d exporter for Maya so this is important to know. I'm not sure I understand Michael's explanation. As I recall quaternion rotation gives a vector using XYZ coordinates and then the amount of rotation around that vector (with the direction of rotation as per the right hand rule;) is this correct?


LAB[au](Posted 2003) [#7]
At least it is the way I understood quaternions as well. A link (by wavey) http://www.dscho.co.uk/blitz/tutorials/quaternions.shtml


jhocking(Posted 2003) [#8]
Something you might be interested/need: I just noticed the source code for the Milkshape exporter (download from the Specs and Utils page) includes a function to convert Euler angles to quaternian rotations. Whew, until I found that I was afraid I would have to figure out the math myself (and I haven't done any linear algebra since high school!) when writing an exporter for Maya. I think Maya stores rotation data as Eulers.