Archived

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

iNsAn1tY

My mind is like a damn sieve...

Recommended Posts

Hi. I have a slight problem. I have forgotten (or never knew) how to create a normal from three values: the rotations around the x, y and z axes. Can anyone help me out? Is there a quick way of doing this? If I crack this, I have a perfectly working selection system...
Movie Quote of the Week:

"You''ve been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!

Share this post


Link to post
Share on other sites
length = sqrt (x*x+y*y+z*z);
x=x/length
y=y/length
z=z/length

hope that helps...just doing this really quick

oops...messed up ...could you explain a bit better? (disregard above (i think)

[edited by - Grizwald on October 1, 2002 5:49:59 PM]

Share this post


Link to post
Share on other sites
I have to project a ray from the viewer''s position (x, y, z) to another point directly in front of where they''re looking, say, 100px. I need to convert the viewer''s look angles to a normal, so then I can multiply RayStart by (Normal * 100) and derive the end of the ray. Does this help any more?

It''s kind of a wierd problem. I think I have a solution to it, but I''m not sure...my head is swimming a little...I need sleep...must program...must sleep...[passes out on keyboard]...


Movie Quote of the Week:

"You''ve been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!

Share this post


Link to post
Share on other sites
well i can''t help you there! i''m still having problems with my mouse selection code...can''t get it to work on the XZ plane correctly, but i hope that me replying will bump this up for ya! good luck

Share this post


Link to post
Share on other sites
Hey, here's one for you all to chew on...could I do this to solve my problem?

Get the current modelview matrix using glGetFloatv(), then multiply a normal (0, 0, -1) by it, and use the resulting normal to derive the ray I need? I think this is possible. I'll go away and test it now, but I was just wondering if anyone could confirm this for me?

By the way, I chose (0, 0, -1) because that's the direction the modelview matrix is pointing when the identity matrix is loaded and no translations are applied, right? Straight down the z axis? Hmmm...


Movie Quote of the Week:

"You've been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It's brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!


[edited by - iNsAn1tY on October 2, 2002 6:08:34 PM]

Share this post


Link to post
Share on other sites
No, as it turns out, you can''t. I''ll have to create a purely roation-only matrix, and multiply a normal by that. This is truning out to be rather irritating...


Movie Quote of the Week:

"You''ve been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!

Share this post


Link to post
Share on other sites
I''m fast coming to the same conclusion: angles suck. I only used that system in my movement functions because it was quick and simple to implement. I was concentrating on other things, but now the time has come to get a more robust system. I''ll head over to gametutorials.com and pick up their camera tutorials...


Movie Quote of the Week:

"You''ve been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!

Share this post


Link to post
Share on other sites