Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0

How to make a model rotate


I have a model (obj) that's a ceiling fan. I want it to rotate, so I added +ROTATE to the zscript file, but instead, it flips like a pancake. What did I do wrong?

Share this post

Link to post

5 answers to this question

Recommended Posts

  • 0

Too much yeast in your batter!


Depends on the orientation of your model and what axis you want it to rotate on.


Model fan
    Path "Models"
    Model 0 "fan.obj"
    SurfaceSkin 0 0 "fan.png"
    Scale 1.0 1.0 1.2
    Rotation-Center 0 0 0
    Rotation-Vector 0 0 1
    Rotation-Speed 8

    FrameIndex MDCA A 0 0


Rotation-Center is relative to your model insertion box.

Rotation-Vector is axis and direction.  Try different combinations (1 0 0), (0 1 0), (0 0 1)


If it's turning in the wrong direction, change vector to -1


Share this post

Link to post
  • 0

That's exactly what I have, and it's still flipping

Tried 1 0 0, 0 0 1 and 0 1 0.


Share this post

Link to post
  • 0
Posted (edited)

Out of curiosity, did you reload all your resources every time you changed MODELDEF?  I only ask because I've worked on a problem for hours and think I've finally come up with the fix and it didn't change.  Then I remembered I didn't reloaded the change.  The brain gets tired after processing the same thing over and over again.


I've also found that you have to consider where the right 0, 0, 0 of your model needs to be as it relates to its use.  If it's going to rotate, the model 0, 0, 0 must be on the rotation axis.  And with large models, if there is a 3D sector that intersects with your model bounding box, it can push it up or down in game.  And don't make the bounding box too big.  Use RenderRadius to capture the extent of your model vice making the Radius big.  I rarely make mine bigger than a 32 unit cube.


Just some lessons learned.  Have you done any MD3 animated models?  Or Switching/Switchable Decorations using 3D models?  There's a whole new set of problems. 

Share this post

Link to post
  • 0

I reloaded each time, and it kept flipping.

And no. I've never worked with md3. The models I use, I create using sectors and importing to obj.

Share this post

Link to post

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