Gimbal Lock
Moderator: Moderators
Gimbal Lock
Hej,
For everyone that is not familiar with the problem that is Gimbal Lock.
You're going to run into this problem when for example wanting to make a 3D space exploration game like Elite or any other situation where you want to rotate over 3 axis. There are two good solutions for this. One is to support Quaternions , the other is Referential rotations ( Euler ).
Thanks ~
Kjell
For everyone that is not familiar with the problem that is Gimbal Lock.
You're going to run into this problem when for example wanting to make a 3D space exploration game like Elite or any other situation where you want to rotate over 3 axis. There are two good solutions for this. One is to support Quaternions , the other is Referential rotations ( Euler ).
Thanks ~
Kjell
Well implementing acos/asin is certainly easier for me than adding a new technique for rotations. The only reason I haven't added all the math-functions from the beginning is that I want to make some kind of function/preprocessor feature so that people that needs a specific function can use that, and it won't add to other peoples file sizes as it will only link in when used. But I think I need to push back those thoughts until I can spend more time on language research, and meanwhile just implement acos/asin as they are small functions anyway.
actually, asin and acos can be easily calculeted with atan2:
http://en.wikipedia.org/wiki/Inverse_tr ... alculation
http://en.wikipedia.org/wiki/Inverse_tr ... alculation
yes, but why not implementing simple asin and acos functions so we don't need to calculate it by ourselves every time ?kattle87 wrote:actually, asin and acos can be easily calculeted with atan2:
http://en.wikipedia.org/wiki/Inverse_tr ... alculation

again, you have atan2(), and that's enought for everyone 
from wikipedia: "Thus implementations of atan(y) will probably choose to compute actually atan2(y,1)."
So, if you want normal atan (instead of atan2 which is best for me because can give you the angle in the [0, 2*PI] range), just use atan2(y,1)
bye!

from wikipedia: "Thus implementations of atan(y) will probably choose to compute actually atan2(y,1)."
So, if you want normal atan (instead of atan2 which is best for me because can give you the angle in the [0, 2*PI] range), just use atan2(y,1)
bye!
i dont want to be rude
, but:
its much easier to write x = acos(angle); then going to wiki, finding the formula then transforming and writing all of that, right ?

imagine someone starts using ZGE and he needs to google for manual asin and acos transformations only because the program doesn't support it ...turshija wrote:yes, but why not implementing simple asin and acos functions so we don't need to calculate it by ourselves every time ?
its much easier to write x = acos(angle); then going to wiki, finding the formula then transforming and writing all of that, right ?
