Gamestudio Links
Zorro Links
Newest Posts
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
3 registered members (AndrewAMD, VoroneTZ, 1 invisible), 1,578 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
angle question #365432
03/26/11 17:56
03/26/11 17:56
Joined: Nov 2010
Posts: 96
Vienna
S
Schubido Offline OP
Junior Member
Schubido  Offline OP
Junior Member
S

Joined: Nov 2010
Posts: 96
Vienna
Hi,

I am a bit confused by angles and rotation.

The manual says, the ranges of the angles are
pan: 0 .. 360
tilt: -90 .. +90
roll: 0 .. 360
(online manual, section ENTITY->pan, tilt, roll)
And it also says, that it is important to keep the angles within this ranges to avoid gimbal lock problems.
Fine, I want to avoid any problem - so I try to keep the angles within the given ranges.

But if I use engine functions (e.g. ang_add, ang_rotate, c_rotate), the ranges of the result angles are:
pan: -180 .. 180
tilt: -90 .. +90
roll: -180 .. 180

I am using GS 8.10 Extra edition.

Does anyone know why the engine functions don't stay in the ranges which are stated in the manual? Or did I get something wrong?


Re: angle question [Re: Schubido] #365434
03/26/11 18:16
03/26/11 18:16
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Gimbal lock happens at tilt = (+/-)90, at which changing pan and roll has the same effect.

In terms of ambiguities, the main concern is tilt. If, for example, your tilt gets to 180 and your roll gets to 180, even though the entity looks like it's oriented upright it'll tilt down when you want it to tilt up and it'll face away from targets when you try to face towards them.

In practice, keeping pan and roll between -180 .. 180 is just as "safe" as using 0 .. 360, but is slightly easier to maintain since you can take advantage of the ang() function to enforce it.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: angle question [Re: JibbSmart] #365438
03/26/11 18:45
03/26/11 18:45
Joined: Nov 2010
Posts: 96
Vienna
S
Schubido Offline OP
Junior Member
Schubido  Offline OP
Junior Member
S

Joined: Nov 2010
Posts: 96
Vienna
Thanks Jibb - this information is quite helpful.
I was "fighting against" the ang... functions to stay within the ranges which were described in the manual smirk


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