rotate around own axis

Moderator
Posts: 1,560
Joined: 2003.10
Post: #31
Conceptually, that should work, unless you're storing your view orientation as the inverse of the direction it's facing (which I've done before without noticing, since otherwise you have to invert before applying the view transformation). What does it actually do?
Quote this message in a reply
Member
Posts: 94
Joined: 2008.08
Post: #32
It just seems to send them straight behind where the camera starts. If I turn and fire again, it still sends them off in the same direction. Its like the the cameras orientation has no affect on which way they are sent.

Ive also tried inverting the quat before assignment but it made no difference.
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #33
Wild guess: Sounds like you have the ships being affected (or not affected) by a matrix you're not expecting. i.e., you might be doing them before your camera transform, or perhaps on an identity matrix (like after glLoadIdentity, which may have cleared off your camera transform). If you actually think they should be on top of the correct transform, then you might want to double check your glPush/popMatrix balance.

Another thought: are you perhaps using glLoadMatrix when you should be using glMultMatrix?
Quote this message in a reply
Member
Posts: 94
Joined: 2008.08
Post: #34
doh, come back to it today and realised I made a very dumb mistake Smile not even going to tell you what it is as its too embarassing Wink Thanks for the help though!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #35
please do tell; we frequently get people coming to these kinds of thread via google and *not* having the answer is frustrating...
Quote this message in a reply
Member
Posts: 94
Joined: 2008.08
Post: #36
well I normally would say the answer, but it was more of a programaticle error. It was basically I wasnt moving the missiles according to the direction Id got from the orientation. So I was basically moving them in the same direction Smile The logic and all the code i posted should work fine Smile
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Seperating Axis Theorem Code mikey 5 4,489 Oct 9, 2010 03:25 PM
Last Post: Oddity007
  Separating Axis Collision Detection Joseph Duchesne 4 4,022 Dec 22, 2005 10:18 AM
Last Post: Leisure Suit Lurie
  Separation axis collision detection SOUR-Monkey 5 5,862 Mar 24, 2005 01:23 AM
Last Post: DoG