Game Development Community

Flip 3d object

by Nils Eikelenboom · in Torque 3D Professional · 01/20/2013 (9:33 pm) · 8 replies

Does anyone have a recource to add 'flip' (or mirror, or whatever you want to call it) for objects?

I'm especially interested to use this for prefabs. Would be good to add this in the editor.

#1
01/21/2013 (4:24 am)
try applying a scale Transform modifier of -1 -1 1

#2
01/21/2013 (5:22 am)
Hi @David, I tried the negative scale modifier values. None (7) gave the wanted result. Moslty 'kind of' rotaded 180 or turned inside out (like flipping the faces). Thanks for the hint :)
#3
01/21/2013 (7:22 am)
I don't think this is supported, mainly because it is almost certainly "better" to build your art purposely for its intended use and artists get upset when you do stuff like this. The validity of this argument is proportional to your personal give-a-damn ratio.

Best I can suggest is to use your favorite modeling tool to do this and include both assets.
#4
01/21/2013 (8:11 am)
hey @Richard, if it's not supported, or if there's no quick solution, then I'll forget this as quick as it came to my mind :)

I'm designing a lot of stuff modular (with grid and all) and sometimes flipping the objects for the sake of variation would be good, without loading an extra mesh.
#5
01/21/2013 (10:41 am)
@Richard
Quote:The validity of this argument is proportional to your personal give-a-damn ratio.
ROFL, That is the funniest thing I read today !
#6
01/21/2013 (10:49 am)
@Scott,
Quote:ROFL, That is the funniest thing I read today!
I second Scott's remark! :)
#7
01/21/2013 (11:07 am)
Flip as in rotate?

%rd = getRandom(0, 1);
if(%rd == 0)
   %rot = "1 0 0 0";
else
   %rot = "0 0 1 180";

      %obj = new TSStatic(%objName)
      {
         shapeName = "your/mesh/location/here";
         playAmbient = "1";
         meshCulling = "0";
         originSort = "0";
         collisionType = "Collision Mesh";
         decalType = "None";
         allowPlayerStep = "1";
         renderNormals = "0";
         forceDetail = "-1";
         position = %pos;
         rotation = %rot;
         scale = "1 1 1";
         canSave = "1";
         canSaveDynamicFields = "1";
      };

Or if you don't want to do it on spawn, get the rotation from the getTransform and then update and reset the setTransform().
#8
01/21/2013 (7:26 pm)
@Steve; I ment 'flip' as mirroring the vertices of the 3d object horizontally or vertically. But thanks!!!

I forgot to keep in mind that most objects will have normal maps. I don't think that flipping those will be a good thing. Creating additional maps would be almost equal to loading extra meshes. So... I will try to forget this.

Thanks!