Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Is this the formula for distance from a plane?

4: Adsense

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
1 reply to this topic

#1 WhatEver   Members   

125
Like
Likes
Like

Posted 02 January 2002 - 10:24 AM

TrinaglePos=Tx*Nx+Ty*Ny+Tz*Nz; PointPos=Px*Nx+Py*Ny+Pz*Nz; Distance=sqrt(PointPos-TrianglePos); T is a Triangle vertex. P is the Point in space. N is the Normal. If I'm right, I'm really starting to understand what the Dot Product does. Edited by - WhatEver on January 2, 2002 5:25:41 PM

#2 Dredge-Master   Members   

175
Like
Likes
Like

Posted 05 January 2002 - 05:36 AM

was easier than typing it out


you weren't too far off


for programming purposes, you probably can't guarentee that |ax+by+cz+d| is positve, and you don't want to call "sqrt()" too many times, so




When coding it, do something like

distance=a*x+b*y+c*z+d;
distance=sqrt(distance*distance/(a*a+b*b+c*c));




Beer - the love catalyst
good ol' homepage


PS - sorry if the image loading is slow. Either my provider or the cable modem is playing up, so it is taking forever to load these images. Should be fixed soon though. Just give it time if it is slow. It is the request that is slowing down, the speed is fine.

Edited by - Dredge-Master on January 5, 2002 12:41:54 PM




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.