Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Rotating in Blender
- - By Clonkonaut Date 2015-03-12 23:33
Because Sven threatened to moderate me, I do now open a thread for my question:

These things are lying around waaay to long. All I really need to is to bring these into the game; unfortunately, Matthi and me never quite found the time to do this together. Aaanyway!

Maikel already asked about scaling. Great, I know that now. What about rotation? I need to rotate and scale the objects until they don't clip into the clonk anymore.

1. How would I rotate an object in blender and save the rotation?

2. How would I rotate an object seperate from its bone(s)? Or rotate the bone separate from the object?`

3. How would I apply rotation I figured out ingame correctly in Blender? E.g. 90° on x-axis in OC is what in Blender?
Reply
Parent - By Zapper [de] Date 2015-03-13 07:29

>1. How would I rotate an object in blender and save the rotation?


If you rotate in edit mode as opposed to object mode, you won't have any problems. If you rotate in object mode, you will have to CTRL+A "Apply Rotation & Scale" afterwards

>2. How would I rotate an object seperate from its bone(s)? Or rotate the bone separate from the object?`


In edit mode. Edit mode only manipulates vertex data directly

>3. How would I apply rotation I figured out ingame correctly in Blender? E.g. 90° on x-axis in OC is what in Blender?


That's a good question.... I think if you hit the 3 on your numpad, your blender perspective becomes the same as the OC perspective, if that helps. But I am frequently guessing myself :I
Parent - By Clonk-Karl [us] Date 2015-03-14 02:54 Edited 2015-03-14 03:00

> How would I apply rotation I figured out ingame correctly in Blender? E.g. 90° on x-axis in OC is what in Blender?


It might be easier to use trial and error, but here is how it should work: the matrix used to convert from OGRE coordinate system to Clonk is:

    0 1  0
X = 0 0 -1
    1 0  0


So my first guess would be you take your rotation matrix R in Clonk coordinates (as given by Trans_Rotate) and transform it into OGRE coordinates. I'd expect this to work if OGRE coordinates are equivalent to Blender coordinates -- I'm not sure whether the OGRE exporter does a coordinate transformation as well; if so you'll have to multiply that transformation from the right with the matrix above. The transformed rotation matrix is given by

R' = X⁻¹ R X

R' will describe a rotation around a different axis with the same angle. In general, you can decompose the rotation matrix with formulas such as found here, but for simple rotations along one of the three coordinate axes it will be obvious at least up to a sign (the rotation axis has a 1 on the diagonal).

Alternatively, and maybe easier, you should also be able to take a vector v describing the rotation axis and transform directly with the inverse of X:

v' = det(X⁻¹) X⁻¹ v = - X⁻¹ v

Note the additional minus sign which comes from v being a pseudovector and X having determinant -1. This should give you the new rotation axis, and the rotation angle does not change.
Reply
Up Topic General / Help and Questions / Rotating in Blender

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill