Jump to content

setObjectRotation Issue..?


=FAS=Shigawire

Recommended Posts

Hey,

im working an a new design for the prox mine.

nearly finished, but its wrong rotated.

So I used setObjectRotation, but now the mine is as flat as a piece of paper... also if i put the rotation directly into the createObject function:

function laymine(player) 
    local posx, posy, posz = getElementPosition ( player ) 
    local landmine = createObject ( 1510, posx, posy, posz --[[ .999--]]) 
    setObjectRotation ( landmine, 90, 0, 3.18 ) 
    local landminecol = createColSphere ( posx, posy, posz, 3 ) 
    setElementData ( landminecol, "type", "alandmine" ) 
    setElementData ( landminecol, "owner", player ) 
    setElementData ( landmine, "type", "proximity" ) 
    setElementParent ( landmine, landminecol ) 
end 

What could that be?

Link to comment
its not flat without rotating :S.
does importing it pre-rotated work

What do you mean by that?

and its the original one that also gives that bug.. whatever it is

That you rotate the object in the file. Because I guess this is a custom object?

So just change the rotation of the object in the txd and dff if possible.

Link to comment
So just change the rotation of the object in the txd and dff if possible. 

I tried that, but it is still wrong :(

But maybe i did it wrong inside Autodesks 3D Studio Max...

If you're using 3ds max, you can't just rotate the object. Remember, when you export an object it has to be placed at 0,0,0 and rotated 0,0,0. So how to make an object rotated? Here is the solution:

1. Select the object

2. Click on Hierarchy tab on the right (where you have Create, Modify, etc.)

3. You should have 3 buttons there (Affect Pivot Only, Affect Object Only and Affect Hierarchy Only), click on Affect Pivot Only

4. Now you should see the arrows (X, Y and Z directions) got greater, you can now rotate/move these arrows around the scene and that will be centre of the object. If you move this to the centre of the object and you place the object in-game (without changing coords) you will see the object has changed its position but you never changed it, that's because object is moved to the place of Pivot location.

5. When you are done with rotating/moving these arrows, click Affect Pivot Only again

6. Now you have to prepare the object for exporting, so select Move Tool, press F12 and set X, Y and Z to 0 (in Absolute:World). Do the same for Rotation, now your object should look like object created in game without rotations.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...