1
   

Linear algebra question

 
 
stuh505
 
Reply Thu 14 Sep, 2006 08:24 pm
Embarrassed

I am writing a raytraced rendering program from scratch right now. I have no idea how this is typically done, I have not read any literature, but the way I am choosing to implement it is by finding the parametric equation for a light ray, and computing the parametric equation of a plane for a geometric face in the scene and then computing the intersection point.

This part is good, but the trouble is that a 'face' has boundaries, and the next thing I need to do is check to see if the intersection point is actually within the boundaries of the face.

The most obvious way to do this is to look down the y dimension, and check to see if the intersection point's x and z components are within the x and z components of the vertices that make up the geometric face. This works in most cases except when the geometric face is vertical or nearly vertical.

To get around this problem, I compute a set of 3 basis vectors that define the image plane, and project the intersection point and all of the geometric vertices into this basis. Then, I can just check to see if the x and y components of the intersection point in this basis are within the boundaries of the x and y coordinates of the geometric face vertices.

However, my intuition was wrong here...one problem is that, in the image plane basis, there is no perspective so a plane that is perpendicular to the image plane will have a valid intersection area of zero...even though it occupies some area in the image.

Does anyone have a suggestion about how I could check the intersection bounds?
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 743 • Replies: 1
No top replies

 
stuh505
 
  1  
Reply Thu 14 Sep, 2006 09:27 pm
Oh, silly me...I could just project into a basis that has 2 axis in the same plane as the face. Problem solved.
0 Replies
 
 

Related Topics

Evolution 101 - Discussion by gungasnake
Typing Equations on a PC - Discussion by Brandon9000
The Future of Artificial Intelligence - Discussion by Brandon9000
The well known Mind vs Brain. - Discussion by crayon851
Scientists Offer Proof of 'Dark Matter' - Discussion by oralloy
Blue Saturn - Discussion by oralloy
Bald Eagle-DDT Myth Still Flying High - Discussion by gungasnake
DDT: A Weapon of Mass Survival - Discussion by gungasnake
 
  1. Forums
  2. » Linear algebra question
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/01/2024 at 08:27:54