Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Gimble Lock - fix it and get paid.

Author
Message
haliop_New
User Banned
Posted: 26th Nov 2016 05:45 Edited at: 26th Nov 2016 05:46
sorry for the double post.


so I'm experiencing gimbal lock and I need to use quaternions angles
I'm not a math guy , I have no idea what to do ...

so I'm offering 50 us dollars to the one who will present me with a fix.
the game is about a spaceship that moves on a track so the camera needs to follow the spaceship.

I guess I can use paypal to pay or if you want a wired transfer its all good.

who is up for the challenge ?

answer me here and my email just in case
nadav.rosenberg787@gmail.com

example of whats happening

Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Nov 2016 10:41 Edited at: 26th Nov 2016 10:45
what is your current code for camera?

some agk quaternions commands
GetObjectQuatW ( objID )
GetObjectQuatX ( objID )
GetObjectQuatY ( objID )
GetObjectQuatZ ( objID )

GetObjectWorldQuatW ( objID )
GetObjectWorldQuatX ( objID )
GetObjectWorldQuatY ( objID )
GetObjectWorldQuatZ ( objID )

SetObjectRotationQuat ( objID, w, x, y, z )

GetCameraQuatW ( cameraID )
GetCameraQuatX ( cameraID )
GetCameraQuatY ( cameraID )
GetCameraQuatZ ( cameraID )

SetCameraRotationQuat ( cameraID, w, x, y, z )

here is a example to turn around a selected axis:
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
haliop_New
User Banned
Posted: 26th Nov 2016 12:17
my current code
is very simple :

1st the spaceship object
2nd the spaceship camera object
3rd the camera



so its pretty simple actually it just follows the given coordinates , the problem is when the axis are aligned as explained in the gimble lock thing...
now looking at it , I don't really need to setobjectlookatcamera for the cameraobject since the camera already do this...

Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Nov 2016 08:20
what is this +50 here? its not transformed from a point above the ship.
SetCameraLookAt(1,GetObjectX(spaceship),GetObjectY(spaceship)+50,GetObjectZ(spaceship),0)
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
haliop_New
User Banned
Posted: 27th Nov 2016 15:31
just so it would look abit higher then the spaceship
i actually changed it using a new object with moveObjectLocalY , you can remove it
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Nov 2016 16:26
my thought was what happens if the ship is up side down, its -50 then.
something relative is better.
ohh then your problem still exist?
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
haliop_New
User Banned
Posted: 27th Nov 2016 22:02
yeah still exist..
I think I need to make the camera follow the spaceship using pure Quat calculations cause as for my understanding if you move from one angle to another using Quat it automatically smooth the transaction...
but again I might have miss understood.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Nov 2016 16:45
It's hard to know for sure without a runnable example, but it sounds like you could detect when the ship is upside down and set the last parameter of SetCameraLookAt to 180, which will flip the camera upside down as well.

Gimbal lock shouldn't be a problem in this case as SetCameraLookAt calculates the necessary angles automatically.
Preben
AGK Studio Developer
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 29th Nov 2016 17:10
Yes the problem here is the rotation of the spaceship object , just see this screenshot from your video.

You could post the code you use to rotate the spaceship , so we can check it out


best regards Preben Eriksen,

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 30th Nov 2016 08:58
Quote: "You could post the code you use to rotate the spaceship ,"

he did.
Quote: "set the last parameter of SetCameraLookAt to 180, which will flip the camera upside down as well."
Preben
AGK Studio Developer
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 30th Nov 2016 10:53
I cant find the code for rotation of the spaceship , only a cameraobject and the camera itself ? , and they actually JUST follow the rotation of the spaceship object , so we need to see how the spaceship object is rotated
best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-03-28 10:08:47
Your offset time is: 2024-03-28 10:08:47