b3d format explain ?
Blitz3D Forums/Blitz3D Programming/b3d format explain ?
| ||
Can anyone could explain why in the b3d format, the brushcolors are stored with values within range 0, 1 ? as , it is stored in float, and we could instead use an integer that can take less space in the file and is faster. work same for vertexcolor etc... other question : what is the fourth rotation for the bones ? NODE: char name[] ;name of node float position[3] ;local... float scale[3] ;coord... float rotation[4] ;system... [MESH|BONE] ;what 'kind' of node this is - if unrecognized, just use a Blitz3D I know pitch, yaw , roll ... what is the last ? the external dimension that hapen only when ufo comes in earth ? :D ... |
| ||
The rotation has 4 values because they are stored as Quaternions not Euler angles. Quaternions represent an arbitrary rotation around a fixed axis and do not suffer the gimbal-lock problem of eulers. It is also very easy to interpolate or "slerp" between Quat values which makes it ideal for animation keys. |
| ||
Colors are stored as a float because the graphics card expects a float. If you think about it, it actually makes sense. 0 is no intensity and 1 is full intensity, regardless of the number of steps in between. So your program can work the same whether you're using 16 bit color, 24 bit color, 32 bit color, or any number of bits that might be used in the future. |
| ||
Ok many thanks. I just have to find a good doc about quaternions now. :) |
| ||
Maybe this? http://www.blitzbasic.com/Community/posts.php?topic=51579#575692 |
| ||
Yep, but the topic does not explain. No problem, i'll find this maybe using Google ;) [edit] I found this : http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm |
| ||
found a very good link ! =>http://www.dscho.co.uk/blitz/tutorials/quaternions.shtml with bb source :) |