Rotating interiors
by Adib Murad · in Torque Game Engine · 12/17/2002 (4:26 pm) · 10 replies
I've been trying to rotate an interior inside my test mission, before giving up and ask for your help.
How does the InteriorInstance's "rotation" property works? It has "1 0 0 0" as default value. Changing to "1 0 0 90" I did a rotation around the X axis, but the same isn't true for the other zeros. Changing to '1 90 0 0', for example, does nothing.
Please, could someone help me?
How does the InteriorInstance's "rotation" property works? It has "1 0 0 0" as default value. Changing to "1 0 0 90" I did a rotation around the X axis, but the same isn't true for the other zeros. Changing to '1 90 0 0', for example, does nothing.
Please, could someone help me?
#2
Seems that if you hold ALT and CTRL+ALT you can manually rotate and resize the interior.
When I started the thread, I was searching for "rotate" in the forums and found nothing. Today, I searched for "rotating" and found the information. I always try, but it's hard to avoid this duplicity of threads.
Thanks, pal.
12/18/2002 (5:42 am)
Great, Max, that's it. I'll try when I get home.Seems that if you hold ALT and CTRL+ALT you can manually rotate and resize the interior.
When I started the thread, I was searching for "rotate" in the forums and found nothing. Today, I searched for "rotating" and found the information. I always try, but it's hard to avoid this duplicity of threads.
Thanks, pal.
#3
That is the point at which my clear understanding ends
The difficulty (for me) is rotating around multiple axes simultaneously. "1 1 0 180" will rotate 180 degrees around both the x and y axes (and is the same as "0 0 1 180" - try it).
But this interchangability is not always the case. Keep in mind that the order of rotation of the axes will usually affect the final orientation, even with the same values, and I am not sure what the actual order is. The final result can also be dependent on whether the axes rotate with the object or not (I can't remember which it is, but a bit of experimentation should tell you).
For instance, if the axes are fixed (are relative to the 'world'), the final result of "1 1 0 90" is different depending on whether the x is rotated first or the y. If the axes are relative to the object and rotate with it, the order of rotation becomes irrelevant.
Finally, you can rotate thru different angles on different axes by modifying the axis value. For instance "1 2 0.5 90" rotates 90 degrees around x, 180 degrees around y, and 45 degrees around z.
Have fun and let me know if you learn anything more concrete.
12/18/2002 (8:43 am)
It is "x y z rotation_angle", where the axis value is multiplied by rotation_angle to determine degrees rotation for each angle. So "1 0 0 90" will rotate it 90 degrees around the x axis. "2 0 0 45" will accomplish the same result.That is the point at which my clear understanding ends
The difficulty (for me) is rotating around multiple axes simultaneously. "1 1 0 180" will rotate 180 degrees around both the x and y axes (and is the same as "0 0 1 180" - try it).
But this interchangability is not always the case. Keep in mind that the order of rotation of the axes will usually affect the final orientation, even with the same values, and I am not sure what the actual order is. The final result can also be dependent on whether the axes rotate with the object or not (I can't remember which it is, but a bit of experimentation should tell you).
For instance, if the axes are fixed (are relative to the 'world'), the final result of "1 1 0 90" is different depending on whether the x is rotated first or the y. If the axes are relative to the object and rotate with it, the order of rotation becomes irrelevant.
Finally, you can rotate thru different angles on different axes by modifying the axis value. For instance "1 2 0.5 90" rotates 90 degrees around x, 180 degrees around y, and 45 degrees around z.
Have fun and let me know if you learn anything more concrete.
#4
Tim, there's no order of rotations here. That's a feature of Euler angles.
Here, you've just got an arbitrary axis and an amount of rotation about that axis. So, only one rotation.
Some people find axis-angle a bit harder to visualize than euler angles, but axis-angle avoids gimbal lock problems.
12/18/2002 (9:53 am)
This is axis-angle notation.Tim, there's no order of rotations here. That's a feature of Euler angles.
Here, you've just got an arbitrary axis and an amount of rotation about that axis. So, only one rotation.
Some people find axis-angle a bit harder to visualize than euler angles, but axis-angle avoids gimbal lock problems.
#5
If I was responding to the incorrect question, please pardon. :)
12/18/2002 (3:48 pm)
I may have misunderstood. I thought he was referring to the rotation property as exposed to the scripting language. That does specify rotation about multiple axes in a single set of values.If I was responding to the incorrect question, please pardon. :)
#6
... can an interior be moved?
I am looking at putting together a submarine sim, and it would be great if I could model a sub and have players walk around in it and have it move around a virtual Torque ocean :)
--Mike
12/24/2002 (8:46 am)
A lil bit off topic, but seeing as you can rotate an interior, I have to ask...... can an interior be moved?
I am looking at putting together a submarine sim, and it would be great if I could model a sub and have players walk around in it and have it move around a virtual Torque ocean :)
--Mike
#7
But possibly for a submarine Sim the light-map issue might not matter since you might not care about them for the terrain -- if you are using the terrain at all.
12/24/2002 (9:04 am)
I believe you can move and rotate an interior during the game play. But the light-maps will not be updated (and the interior's shadow will stay where it was before you moved it). You can force a recalc of the bitmap but this usually takes some time to compute.But possibly for a submarine Sim the light-map issue might not matter since you might not care about them for the terrain -- if you are using the terrain at all.
#8
It seems like that would be a little simpler; of course it wouldn't really let you surface and walk around . . .
12/27/2002 (4:57 am)
It seems to me as though something like a Submarine sim wouldn't need to have 'actual' movement of the ships and contents. Instead, the ship interiors might be unmoving, maybe under the ground, but the controls in that interior move a ship model around out in the ocean, and the viewports of the ship all show the view from that ship.It seems like that would be a little simpler; of course it wouldn't really let you surface and walk around . . .
#9
12/27/2002 (5:27 am)
when i was first conceptualising for my game i wanted vehicles with interiors. I can see now collision meshes impact performance to an extreme degree. i like the idea of seperating the interior of a vehicle and exterior. It wouldnt allow perfect interaction, but it would allow for more indepth vehicles.
#10
... but as someone mentioned, when you surface, you'd have to be stuck at one location on the bridge, and couldn't walk around the deck... which was kinda what I wanted to do...
... oh well :)
Hey, is the performance hit really that bad (collision meshes)?
--Mike
12/27/2002 (6:31 am)
Yeah... it seems like all the 3D engines I've worked with, the solution would be to have the submarine interior as a fixed 'structure' outside of the field of play...... but as someone mentioned, when you surface, you'd have to be stuck at one location on the bridge, and couldn't walk around the deck... which was kinda what I wanted to do...
... oh well :)
Hey, is the performance hit really that bad (collision meshes)?
--Mike
Torque Owner Max Robinson
Seems to be a x,y,z vector with a scalar or something thrown in at the end. If you want to rotate it around a single axis, just make it's value 1.
For instance, rotate 90 around y axis is "0 1 0 90", z could be "0 0 1 90", and you can throw in any value you want for the last number. Now when you are doing multiple axes, I wouldn't do it by writing in the number...