Page 1 of 1

Quaternions

Posted: Sat Dec 10, 2011 5:52 am
by RedSnappa
I am still having the problem where my portal cameras are rolled over. Basically, if the portal camera and portal surface entities do not point in the same direction, the portal camera rolls over by the same number of degrees. Based on the solutions I have tried that haven't worked, I am beginning to think this is a gimbal lock problem. Which leads me to propose the following: Is there any way I can use quaternions in GtkRadiant to perform a spatial rotation?

Re: Quaternions

Posted: Sat Dec 10, 2011 6:34 am
by johnnyenglish
I think you can use the angles key on the camera, not sure, haven't checked.

key value
angles roll pitch yaw

Re: Quaternions

Posted: Sat Dec 10, 2011 10:52 am
by DagF
Portal camera. This camera is used to project its view onto a portal surface in the level through the intermediary of a misc_portal_surface entity. Use the "angles" key or target a target_position or info_notnull entity to set the camera's pointing direction.
-------- KEYS --------
angles : this sets the pitch and yaw aiming angles of the portal camera (default 0 0). Use "roll" key to set roll angle.
target : point this to a target_position entity to set the camera's pointing direction.
targetname : a misc_portal_surface portal surface indicator must point to this.
roll : roll angle of camera. A value of 0 is upside down and 180 is the same as the player's view.
notfree : when set to 1, entity will not spawn in "Free for all" and "Tournament" modes.
notteam : when set to 1, entity will not spawn in "Teamplay" and "CTF" modes.
notsingle : when set to 1, entity will not spawn in Single Player mode (bot play mode).
-------- SPAWNFLAGS --------
SLOWROTATE : makes the portal camera rotate slowly along the roll axis.
FASTROTATE : makes the portal camera rotate faster along the roll axis.
-------- NOTES --------
Both the setting "angles" key or "targeting a target_position" methods can be used to aim the camera. However, the target_position method is simpler. In both cases, the "roll" key must be used to set the roll angle. If either the SLOWROTATE or FASTROTATE spawnflag is set, then the "roll" value is irrelevant.

So set the roll key to a 180 and if you want to aim it the rgith way without playing to much with the numbers youse a target_position.

Hope this helps ;)

Re: Quaternions

Posted: Sat Dec 10, 2011 1:02 pm
by RedSnappa
Tried that already. Not working. The roll is setting itself equal to the difference in the angles of the portal surface and portal camera. The only thing I haven't tried is an angles key on the portal surface.

EDIT: I looked at this again and it seems that the roll key is working. I thought I had tried it but maybe I didn't. I still want quaternions though. It is a better way to perform rotations and avoids the gimbal lock problem.