The rotating command for modeldefs is cool. It can be used for far more than just making a pickup spin. eg The electrical ball thing from Strife with the green ball rotating inside 3 columns can be done far more smoothly with a rotating model for the ball and a second static one for the columns than with an animated model - even with additional frames and interpolation.
So I'd like to see more rotation options if possible. It's be nice to be able to specify rotation speed and direction. Perhaps both could be achieved with a single parameter. A number for speed or rotation (or time taken for 1 rotation if that's better). If the number is +ve, the current default direction is used. If it's -ve then it rotates in the reverse direction.
Any chance?
More flexible model rotating
Moderator: Graf Zahl
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
- ChupaReaper
- Posts: 202
- Joined: Fri Jun 15, 2007 16:35
- Location: England
- Contact:
- TheDarkArchon
- Posts: 1000
- Joined: Wed Jul 06, 2005 11:58
- Location: What's that fucking smell
- Contact:
- Torr Samaho
- Developer
- Posts: 160
- Joined: Fri Apr 13, 2007 8:26
- Location: Germany
- Contact:
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
Hmmm... yes I see what you mean by that. A common position for the origin of a model that stands on the ground is in the middle of the object, viewed from above, but at ground level. Rotating that anything other than horizontally would push it into the ground. But placing the origin higher in the model would mean the object sits in the ground anyway.
For a simple, static decoration, I would make the decoration have the +nogravity flag and then place the thing itself a suitable number of units above the floor. However, that would mean that it couldn't be used on a moving floor, for example. And then what if I wanted to have something apparently rolling along the ground...
So, yes, I think some sort of Z offset built into the model definition would be good. I think it would work best to have a number that specified a Z offset relative to the model's origin purely for rotating purposes. It would need to be possible to enter the number as either +ve ore -ve (takes care of hanging objects and other odd situations). A system like that would leave all the normal model creation and placing stuff as it is at present but allow things to be tailored for rotating via the modeldef lump.
For a simple, static decoration, I would make the decoration have the +nogravity flag and then place the thing itself a suitable number of units above the floor. However, that would mean that it couldn't be used on a moving floor, for example. And then what if I wanted to have something apparently rolling along the ground...
So, yes, I think some sort of Z offset built into the model definition would be good. I think it would work best to have a number that specified a Z offset relative to the model's origin purely for rotating purposes. It would need to be possible to enter the number as either +ve ore -ve (takes care of hanging objects and other odd situations). A system like that would leave all the normal model creation and placing stuff as it is at present but allow things to be tailored for rotating via the modeldef lump.
- Torr Samaho
- Developer
- Posts: 160
- Joined: Fri Apr 13, 2007 8:26
- Location: Germany
- Contact:
I added zoffset support to MODELDEF some time ago, it's definitely in GZDoom 1.0.29. Just add a "zoffset float" line to your MODELDEF.
And I just finished a first implementation of the customizable rotation:
With this, you should be able to achieve the rotation you described.
And I just finished a first implementation of the customizable rotation:
Code: Select all
- Made the model rotation customizable:
rotation-speed float: Specify the speed of the rotation
rotation-vector float float float: Specify the x, y and z component of the vector of the rotation
rotation-center float float float: Specify the x, y and z coordinate of the center of the rotation
(Defining rotation initializes the speed to 1, the vector to (0,1,0) and the center to (0,0,0))
- Torr Samaho
- Developer
- Posts: 160
- Joined: Fri Apr 13, 2007 8:26
- Location: Germany
- Contact: