redeclipse / base

Base environment for Red Eclipse and associated source files.
https://redeclipse.net/
437 stars 90 forks source link

spinpitch and spinyaw have the same result #562

Closed ghost closed 8 years ago

ghost commented 8 years ago

I'm trying to make fans spin in 1.5.5 and I've found that spinpitch and spinyaw properties have the same result. One of them spins along the wrong axis.

IceflowRE commented 8 years ago

I can not confirm. One look into the code says this:

animmodel.h line 1012 vec(m->offsetyaw + m->spinyaw*lastmillis/1000.0f, m->offsetpitch + m->spinpitch*lastmillis/1000.0f, m->offsetroll + m->spinroll*lastmillis/1000.0f)

ghost commented 8 years ago

Just start an empty map, add mapmodel and try changing spinpitch and spinyaw.

IceflowRE commented 8 years ago

I would not "not confirm" if i had not tested it. https://www.youtube.com/watch?v=rBfdzITMeSI

bonifarz commented 8 years ago

Well, it seems to depend on the model. E.g. spinpitch works fine on dziq's models, but does not do anything on Jojo's and Luckystrike's. Maybe some mesh format / config issue?

qreeves commented 8 years ago

I think it depends on the orientation the model has, if pitch doesn't work, use roll, and vice versa.

ghost commented 8 years ago

This doesn't work on luckystrike/fan01 model. I've tried all combinations of spins.

bonifarz commented 8 years ago

Is that actually for a map fix, i.e. for an axis of rotation that was possible in earlier versions? As far as I remember, if you changed the fan model's pitch, it kept rotating along the z (vertical) axis, which looked really silly (like a spinning coin). Still, one may expect that with the new spin attributes, any direction for the spin axis should be possible, so I guess there is still some small issue.

ghost commented 8 years ago

Yes, I can't fix Train because the plane uses those fans.

bonifarz commented 8 years ago

I just had another look at this. The rotors on your air craft thingie, right? You used roll 90. Try yaw 90 pitch 90 instead. Then spinroll should give you the desired result. Honestly, I'm not sure if there's a glitch/bug.

ghost commented 8 years ago

I'd wait for this bug to be fixed.

graphitemaster commented 8 years ago

Gimbal lock strikes again. This is not actually a fixable bug. When you have rotations of models represented with euler angles (yaw, pitch, roll) you can align oone axis of movement against the gimbal of another locking them together such that manipulating either of them results in the same rotation or no rotation at all. This is because euler is a concatenative transformation. I wouldn't label this a bug, it's just a lack of understanding euler angles.