# Unknown value - just or fun.

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

## Recommended Posts

Given the vertices for a poygon (tri or quad) , the face vertex list, and the normal for the polygon, a single floating point number is also given.

Question is what does the value relate to?

example 1

v1   30.9, 234.51, -4.32
v2   -114.77, 117.93, 36.38
v3   52.97, 117.93, 145.31

normal   -0.390294  0.697474, 0.601

unknown value  -148.91

example 2

v1 -59.72, 163.79, 98.19
v2 -5.21, 177.91, 16.89
v3 10.44, 119.18, 88.13

normal   0.520179, 0.711538, 0.472364

unknown value   -131.862

We are porting a viewer to linux and mac, the unknown value isn't essential for the program, just wondering what it is.

##### Share on other sites
Buckeye is right.

value = -dot_product(normal, v1) = -dot_product(normal,v2) = -dot_product(normal,v3)

##### Share on other sites

Wow thanks,

never seen that before, any ideas for it's use?

(The program being ported is used to create unfolded nets from 3D geometry.)

FYI, I think the normals are negated not the distance.

##### Share on other sites

The triangle is contained in a plane. If you want to test whether a point is to one side of the plane or the other, you simply check the sign of `dot_product(point - origin, normal) + value'.

##### Share on other sites

Re: how plane equations are used - collision detection, raycasting, determining the point in the plane closest to a given point - all of which would use the form of the plane equation Alvaro mentions.

The latter use would be something like:

Given point V, assuming origin is (0,0,0):

D = dot_product(V, normal) + d

Closest point in the plane to VP = V - D*normal

That may be where you see the normal negated.

Edited by Buckeye

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633759
• Total Posts
3013719
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!