#### Archived

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

# My mind is like a damn sieve...

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

## 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 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 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 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 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 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 on other sites
Which is why I learnt that angles really suck! I just use right, up and front vectors now: very clean, and a lot easier to work with.

##### 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!

1. 1
2. 2
3. 3
Rutin
24
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633651
• Total Posts
3013131
×