Jump to content

  • Log In with Google      Sign In   
  • Create Account

Define a plane knowing a point and the normal


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Alessandro   Members   -  Reputation: 296

Like
0Likes
Like

Posted 11 December 2011 - 09:59 AM

I'm developing an opengl application and I have cast a ray from the camera to a point in 3D space. I would like to define a plane where such point lays, with the cast ray vector perpendicular to such plane.
Is it possible? If it's not clear I can make an image.

Sponsor:

#2 ic0de   Members   -  Reputation: 841

Like
-1Likes
Like

Posted 11 December 2011 - 11:15 AM

I'm developing an opengl application and I have cast a ray from the camera to a point in 3D space. I would like to define a plane where such point lays, with the cast ray vector perpendicular to such plane.
Is it possible? If it's not clear I can make an image.


You should be able to define this plane if you know the tangent and the binormal, which can be derived from the normal.

We know that these vectors are both perpendicular to the normal. To find the tangent you will find two vectors perpendicular to the normal and pick one depending on whether the normal is positive or negative, the binormal will be the cross product of the tangent and the normal and at that point you should have enough information to define a plane, this will however be a massive burden on your CPU if you want to do this in real time so see if you can offload some calculations to the GPU using shaders or OpenCL.


you know you program too much when you start ending sentences with semicolons;


#3 heron3d   Members   -  Reputation: 132

Like
-1Likes
Like

Posted 11 December 2011 - 01:39 PM

I'm developing an opengl application and I have cast a ray from the camera to a point in 3D space. I would like to define a plane where such point lays, with the cast ray vector perpendicular to such plane.
Is it possible? If it's not clear I can make an image.


could you get the cross product between your ray and the world up vector and then the cross product of that vector with the ray

ray X worldUpVec = U
ray X U = V

plane defined by the point in 3d space, U and V.

perhaps

#4 dpadam450   Members   -  Reputation: 923

Like
0Likes
Like

Posted 12 December 2011 - 07:07 PM

What do you mean by define a plane? The above two comments are in regards to geometrically computing 4 points for an actual plane you can draw. The definition of a plane though is a point and normal. You have a point and normal, you have a plane equation.

#5 Alessandro   Members   -  Reputation: 296

Like
0Likes
Like

Posted 13 December 2011 - 10:23 AM

Thanks Adam, any chance to have a C++ example about calculating a plane from a normal vector and a point?

#6 Dirk Gregorius   Members   -  Reputation: 786

Like
1Likes
Like

Posted 13 December 2011 - 11:32 AM

A plane isdefined like P: n*x - d = 0

Given a point on the plane and a plane normal the plane can be defined as: n*x - n*p= 0
(Note that bold letter indicate vectors and * is the dot product)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS