Hello All,

Well this is not exactly a C++ question. More of a math one. But I've seen many guys work on GameDev in this forum. So, posting it here.

Here it goes:
I was reading an article to check if a point in view frustum and i read some DX article and i read the following:

DotProductPlane

*Computes the dot product of a plane and a 3D vector. *

Now, i'm not able to understand what's the dot product between a plane and a vector.

Thanks!
PS: Sorry for posting it in the C++ forum

The page says exactly what it is...

Which translates into human readable text as: the dot product gives the distance between points in space.
In this case that's the distance between a point and a plane.

Planes are represented in the general linear form. This form can be understood as a normal vector `n = (a,b,c)` and a distance `d` between the plane and the origin, along the normal vector. So, for any point `(x,y,z)`, you can compute the following:

``````a*x + b*y + c*z + d
``````

which will be `0` if the point is on the plane, and it will be positive or negative, depending on whether the point is above or below the plane. This is the operation that DX calls "dot product of a plane and a vector". It is essentially the dot product of the vector with the normal of the plane, and then, offsetted by the distance of the plane to the origin, such that you get these negative (below), zero (on plane) and positive (above) values.

@mike_2000_17

This is the operation that DX calls "dot product of a plane and a vector". It is essentially the dot product of the vector with the normal of the plane, and then, offsetted by the distance of the plane to the origin, such that you get these negative (below), zero (on plane) and positive (above) values.

That was precisely what i was looking for. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.