Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,170 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How do you find change in angles? #6124
07/22/01 14:32
07/22/01 14:32
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
I have an entity that is using the ROTATE and move commands to make a big loop.

As it's TILT angle crosses the +-90 degree mark, All angles change in odd ways for each frame, even though the object looks correctly oriented.

For example, my entity is doing a big loop starting with all angles at zero, and rotating by a positive tilt amount with each frame.

While everything looks fine all the time, if I display the angles that it is using, I see a smooth transition of tilt from 0 to 90 while pan and roll stay at zero. Then when 90 is hit, my pan flips by 180, my tilt values start decreasing, and my roll angles seem to alternate between positive and negative.

This happens until the entity completes half a circle, and then all the values seem normal again: Tilt is at -90 and counting up towards +90, while Pan and Roll are at zero again.

Question 1) Please explain what the engine is doing.


Question 2) If I use the normal code to point at something:
VEC_DIFF(temp,target.x, my.x)
vec_to_angle(my.pan,temp)

The entity that is trying to point at the target that is being ROTATED will flip upside-down when the targets angles start getting wierd.

Is there a way to point at an object, perhaps something using the ROTATE command that would fix this problem?


Question 3) Assuming that I have the 3 angles from before and after the rotate instruction, how can I find the **Apparent** change in all 3 angles. (In this case, I would expect pan and roll to always be zero, and the tilt value would come back with whatever my tilt constant was set to all through a complete revolution)

Please help!!

- (Still) Disoriented WildCat



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: How do you find change in angles? #6125
07/23/01 18:22
07/23/01 18:22

A
Anonymous
Unregistered
Anonymous
Unregistered
A



This happens when angles exceed the valid limits of Euler angles.

Tilt is only defined between -90 and +90 degrees. When you exceed 90 degrees, the engine tries to guess what you intend with that value. In your case the engine comes to the conclusion that you probably want the flip your object upside down - so it reduces the tilt angle, but flips pan to 180 degrees. Therefore your object is oriented like you want it - but its angles are corrected by the engine to valid Euler angle values.

vec_diff won't deliver an angle difference - it is only for coordinate differences.


Re: How do you find change in angles? #6126
07/24/01 01:34
07/24/01 01:34
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
Thanks, JCL.

I suspected that might be the case. Can you recommend a solution?

-WildCat

P.S. OOps... sorry, I guess this is technical! (I still need a solution though)



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: How do you find change in angles? #6127
07/26/01 07:25
07/26/01 07:25

A
Anonymous
Unregistered
Anonymous
Unregistered
A



One solution might be to add code so when you hit -90 degrees it changes to +90 degrees and when you get to +90 it goes to -90. I think this would work. Im sure someone can correct me if I am wrong...

Re: How do you find change in angles? #6128
07/25/01 23:14
07/25/01 23:14
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
** Can someone move this thread to Technical Area please **


AcidCrow,
That was the first thing that I tried. The problem is that it's not JUST when you hit +- 90, it's 90 degrees of problem. While you are in it, ROTATE is changing all 3 angles, PAN, Tilt and Rotate... and by different amounts depending on your current orientation.

-WildCat



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1