Advertisement

Planes..

Started by March 01, 2001 12:32 AM
3 comments, last by Galileo430 23 years, 11 months ago
Ok, tried to get a answer before maybe this will help. Below is the struct that Quake uses to define a plane. I understand normal and type but what is dist?? typedef struct { float normal[3]; float dist; int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate } dplane_t;
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Picture a line parallel to the normal running through the origin. The dist is the distance from the origin to the plane, along this line. (which just happens to be the shortest distance to the plane) A distance of 0 would have the plane going through the origin. If the normal was (1,1,0), and the distance was 1, the plane would run through the point (sqrt(2)/2, sqrt(2)/2, 0). If you check the distance of this point, it is 1. Anyway, that''s the crappiest explanation on the planet of what distance is. Somebody help this guy out that''s better at explaining things.
Advertisement
I don''t quite get it.. However it''s a better start then I got before.
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Say you have a plane defined by z=5. It''s normal is (0,0,1), i.e. straight down the z axis in the positive direction. It''s distance is 5. If instead the plane was defined by z=4, the normal would still be (0,0,1), but the distance would be 4. If instead the plane was defined by x=4, the normal would be (1,0,0) and the distance would still be 4. The normal only gives a direction like whether a wall is north, south, east or west of you, but it doesn''t tell you how far it is to the wall. There may be several walls south of you, but they are each a differant distance from you.
Keys to success: Ability, ambition and opportunity.
Thx, Got it.
------------------------------------------------------------I wrote the best video game ever, then I woke up...

This topic is closed to new replies.

Advertisement