• Welcome to Dark Bit Factory & Gravity.
 

Euler rotation => Quaternion rotation [BB2D]

Started by Devils Child, June 30, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Jim

The difficulty is still - what's the question/problem? - not what the answer is :)

Jim
Challenge Trophies Won:

Devils Child

#21
aaaah now i see it. it's a wireframe cube! sry my dumbness, i thought it was an engline without sample.
thats exactly what i need!
thank you :updance:

edit: this is compatible with 4x4 matrices?
or do i actually need 4x4 matrices or do i just need 3x3 matrices?
i need {rot/scale/pos}

Stonemonkey

Glad you see it now :) If you want you can use create_entity to create a camera in main() too, then you need to send that through to the rotate_vertices function where you can multiply the camera and the object matrices and use the result to do the rotation (along with some calcs for the position of the object in camera space), you can put scaling into that matrix too. That matrix can be used for the top-left 9 elements of the opengl matrix and the position is put into either the right column or the bottom row (can't remember which) but you might need to negate z somehow.

I don't have any blitz code, I put this together from bits and pieces from other languages but if you want I can add in some more of that stuff.

Devils Child

now, i see EXACTLY what this is all about!

instead of:
vglMatrixRotate(rotation, rotation, rotation)
i do:
for i = 1 to rotation
    vglMatrixRotate(1, 1, 1)
next


now i only have to do a dynamic matrix system in which the user can create more matrices (for each entity one) now i really got it! thanks a lot guys! i will write it down right away!!!
:inspired:

Stonemonkey

That would be slightly different, it would work but you'd only be able to rotate in fixed step sizes (e.g. 1 degree steps). Whichever way though, I think you do need to store the whole matrix for each object.