iMiniB3d set entity Matrix

BlitzMax Forums/MiniB3D Module/iMiniB3d set entity Matrix

ima747(Posted 2012) [#1]
How does one overwrite the matrix of an entity? Nothing I have tried seems to actually have any effect, and I'm not sure why so I'm sure I'm just going about everything entirely wrongly.

To expand I'm trying to take data from the gyro and apply it to an entity, and the pitch/yaw/roll values just do not work for that at all (first pitch is inverted, and second yaw and roll are dependent on each other in some capacity, so how to apply them is daunting to say the least). The rotation information is delivered in a CMAttitude which includes roll/pitch/yaw (which is all kinds of missaligned and not helpful), a CMRotationMatrix which is a 3x3 matrix, or CMQuaternion quaternion which I have been trying to use the quat tools to turn into a matrix and apply, but there is no change.


AdamRedwoods(Posted 2013) [#2]
iminib3d may be using px,py,pz to set the matrix, so upon calling position or rotate entity (parent/child too), it will call UpdateMat() which wipes out whatever you set the matrix to.

i'm referencing the original minib3d code.


Kryzon(Posted 2013) [#3]
Have you tried...
[bbcode]QuatToMat( (float)CMQuaternion.w, (float)CMQuaternion.x, (float)CMQuaternion.y, (float)CMQuaternion.z, yourEntity.mat )
[/bbcode]The above per every logic cycle.


ima747(Posted 2013) [#4]
Thanks for the replies.

re: adam
I am just trying to set that matrix and then render the scene, no additional changes. Will review this again perhaps I missed something (always possible)

re: kryzon
Yes, I have tried that among other things.