Sign in to follow this  
Followers 0
Kavawuvi

(Dynamic) object rotation?

17 posts in this topic

In the scenario tag, Sparky's plugins report rotation as yaw/pitch/roll in radians. This seems to be correct, but I noticed that when an object is spawned, the orientation isn't the same scale as what was in the scenario tag.

I read a list of offsets that was provided by someone who wrote plugins for an old, now dead server mod of Halo PC called Phasor.
 

obj_pitch = readfloat(m_object, 0x74) -- Confirmed. In Radians. (-1 to 1)
obj_yaw = readfloat(m_object, 0x78) -- Confirmed. In Radians. (-1 to 1)
obj_roll = readfloat(m_object, 0x7C) -- Confirmed. In Radians. (-1 to 1)

One problem is that pitch and yaw are switched. That isn't a big problem, as guessing between three values will only take me about five minutes to figure out from experimenting.

The big problem is that it says it's in radians, but radians are -π to π for a complete circle, not -1 to 1.

Does anyone have any correct information on what rotation is for dynamic objects?

Share this post


Link to post
Share on other sites

Tiddy-bits:

an old, now dead server mod of Halo PC called Phasor.

Phasor is dead? I remember Oxide... he helped me write my first programs to read the Halo mapfile.

The big problem is that it says it's in radians, but radians are -π to π for a complete circle, not -1 to 1.

Does anyone have any correct information on what rotation is for dynamic objects?

If it really is -1 to 1, then maybe -1 to 1 represents the whole circle? That'd be radians/π.
NeX likes this

Share this post


Link to post
Share on other sites

Good ol' Smiley and his offsets. Man, I used to love making scripts for Phasor, I once had one that was a CoD-style classes gametype, you selected your class, and it took effect the next time you spawned. Loadouts, health, shields, speed, etc. I even added a sneak class with a cool invisibility algorithm that made them fade into and out of sight, slowly erring on the side of invisi until they were completely camouflaged. A shot would bring them back to visibility, and then the fade-out process would start again. An almost cosine-style function, but slowly deprecating.

Kavawuvi likes this

KsqHutE.png

Share this post


Link to post
Share on other sites

Good ol' Smiley and his offsets. Man, I used to love making scripts for Phasor, I once had one that was a CoD-style classes gametype, you selected your class, and it took effect the next time you spawned. Loadouts, health, shields, speed, etc. I even added a sneak class with a cool invisibility algorithm that made them fade into and out of sight, slowly erring on the side of invisi until they were completely camouflaged. A shot would bring them back to visibility, and then the fade-out process would start again. An almost cosine-style function, but slowly deprecating.

One of the things I miss about Phasor that isn't in SAPP is how much control over the game you can have with plugins. Sure you can balance teams or make a CarnageBot, but it wasn't open ended like Phasor's scripting.

HaloMD used to use Phasor for primarily hosting servers, but we switched to SAPP due to its no-lead.

 

If it really is -1 to 1, then maybe -1 to 1 represents the whole circle? That'd be radians/π.

I'm going to experiment then, using three values inputted into the scenario tag: 0, π, and -π. If it's radians/π, then 0 should remain 0, the positive pi should be 1, and negative pi should be -1.

edit:

So, using the default values from Halo, the orientation of the ring is...

Yaw = -0.418879

Pitch = 0.000000

Roll = -0.174533

radians/π * π = radians

When loaded into Halo and then multiplied the current orientation by pi,

Yaw -> 2.879988

Pitch -> -1.258388

Roll -> 0.221888

The values aren't even close...

Edited by 002

Share this post


Link to post
Share on other sites

I'm going to experiment then, using three values inputted into the scenario tag: 0, π, and -π. If it's radians/π, then 0 should remain 0, the positive pi should be 1, and negative pi should be -1.

Wait what. The plugin says the range of values is 1 to -1. If you inserted π, you broke that range.

I don't follow your experiment.

Share this post


Link to post
Share on other sites

Wait what. The plugin says the range of values is 1 to -1. If you inserted π, you broke that range.

I don't follow your experiment.

If it's 1 = radians/π, then if you multiply by π, you convert to radians. Here's the math:

1 = radians/π

1 x π = radians/π x π

π = radians

The scenario tag uses radians from -π to π, so if I were to input π, Halo would set the orientation to 1. This isn't true, though, and the experiment failed. I'll just post results of what happened in a sec...

Edited by 002

Share this post


Link to post
Share on other sites

I looked at it some more and found that they could be coordinates on a sphere with a radius equal to 1...

Edited by 002
WaeV likes this

Share this post


Link to post
Share on other sites

Did you fix it?

I think you're looking at quaternions. Which parameters are you looking at, and, it's of a map, right? 

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.