Archived

This topic is now archived and is closed to further replies.

X Direction?

This topic is 5986 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

When my car is moving right OpenGL says it moving in the negative X Direction? I thought this way was always positive?

Share on other sites
This would be true if you rotate the y axis by 180o.

Hope that helps a bit.

_____________________________

And the Phoenix shall rise from the ashes...

--Thunder_Hawk -- ¦þ
______________________________

Share on other sites
quote:
Original post by Thunder_Hawk
This would be true if you rotate the y axis by 180o.

Hope that helps a bit.

_____________________________

And the Phoenix shall rise from the ashes...

--Thunder_Hawk -- ¦þ
______________________________

Don''t think I''m rotating it 180o, but if I did rotate it 180o would it correct everything?

Share on other sites
It sounds although you''ve forgotten that the Z axis goes negative into the screen, and planned all your geometry assuming a positive Z axis... which is effectively rotating your Y axis by 180 degrees.

Wow, i hope that made sense. This may be better explained with a diagram, except i cant draw.

Share on other sites
So what would be a good means of correcting this? I was also just wondering if positive rotation on the Z axis is clockwise, or anticlockwise?

Share on other sites
Ok, I''m detecting a lot of confusion in here. The way I see it, there are two distinct (and mutally exclusive) possibilities here:

1) You''ve somehow rotated the scene 180 degrees, or you''re looking at it from the other direction (-z instead of positive). This was suggested by Thunder_Hawk above.

2) You''ve got you''re model saved wrong: it assumes a left handed coordinate system (like Direct3D) instead of a right handed coordinate system (like OpenGL), or vice versa. This was suggested by sark.

If it was 1), odds are your car went backward the first time you tried it, and you added a negative somewhere to fix it. If it was 2), you probably got a car model from somewhere that was saving them with the opposite axes. Or, it could be a problem with the way you''ve set up the projection or modelview matricies. Or, something else entierly. Or, cosmic rays refelcting off the atmosphere of Venus and flipping a bit in you''re RAM. Without more information, I really can''t tell you.

Of course, my money''s on the cosmic rays.

--Khaydarian

Share on other sites
quote:
Original post by Khaydarian
Or, something else entierly. Or, cosmic rays refelcting off the atmosphere of Venus and flipping a bit in you''re RAM. Without more information, I really can''t tell you.

Of course, my money''s on the cosmic rays.

--Khaydarian

Yes, the answer to all 2-day bugs.

_____________________________

And the Phoenix shall rise from the ashes...

--Thunder_Hawk -- ¦þ
______________________________

Share on other sites
quote:
Original post by Khaydarian
Ok, I''m detecting a lot of confusion in here. The way I see it, there are two distinct (and mutally exclusive) possibilities here:

1) You''ve somehow rotated the scene 180 degrees, or you''re looking at it from the other direction (-z instead of positive). This was suggested by Thunder_Hawk above.

2) You''ve got you''re model saved wrong: it assumes a left handed coordinate system (like Direct3D) instead of a right handed coordinate system (like OpenGL), or vice versa. This was suggested by sark.

If it was 1), odds are your car went backward the first time you tried it, and you added a negative somewhere to fix it. If it was 2), you probably got a car model from somewhere that was saving them with the opposite axes. Or, it could be a problem with the way you''ve set up the projection or modelview matricies. Or, something else entierly. Or, cosmic rays refelcting off the atmosphere of Venus and flipping a bit in you''re RAM. Without more information, I really can''t tell you.

Of course, my money''s on the cosmic rays.

--Khaydarian

Yeah I too was exploring the effects of cosimc rays from Venus with little result.

My game is a GTA style car game (overhead racer). I translate -20.0f on the Z axis before I draw anything so that I can actually see the amount of the map I want. I don''t use a car model yet, its only a textured quad so I don''t think that would be effecting it? I only rotate the car on the Z axis by which way the car is facing, but when I rotate the car by 90 degrees it faces left? Everything is reversed almost? If you need to see any code just ask for what you need and I shall post

Share on other sites
Roating 90 degrees should point it left, assuming it started facing forward (top of screen). Positive is COUNTERclockwise when looking down the z-axis from negative to positive. If you want 90 to mean right, just, rotate by -yourdegrees.

edit - I said clockwise. X.x

[edited by - Deyja on July 19, 2002 11:57:17 PM]

Share on other sites
But I''m translating -20.0f into the screen before I draw, wouldn''t that mean I''m looking positive to negative?

1. 1
2. 2
3. 3
Rutin
17
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• Forum Statistics

• Total Topics
633660
• Total Posts
3013218
×