Skip to main content
GameDev.net gamedev.net
🔒 Locked

Stefan's MAP loading tutorial ERRATA

Started by sebarnolds Feb 18, 2003 at 5:28 AM 1 replies 400+ views
Original Post
sebarnolds
sebarnolds
Hi ! This is a small errata for all of you who use the MAP loading tutorial from there: http://folk.uio.no/stefanha/MAPFiles.pdf Hi warned the author and he will correct that but he doesn''t have much time for that now. So, I post some messages on the most popular forums or game programming. In the SplitPolygon function (at the end of the tutorial), the "p" value is not "p = -( pPlane_->n.Dot (pPoly_->vertices[ n ]) + pPlane_->d)) / denom;" but "p = -( pPlane_->n.Dot (pPoly_->vertices[ n ]) - pPlane_->d)) / denom;" This was the correct answer, now some explainations. A line''s equation is: "s + (e - s) * p = x" where s is the first vector of the line, e the second one and p is a real value (the one we are searching in the tutorial). It gives a vector x which is on the line. A plane''s equation is "n . x + D = 0" where n is the normal vector of the line, x a vector on the plane and D the plane''s translation. Note that "." is the dot product and that we will define "d" as "d = e - s". In the tutorial we want to find the intersection between the line and the plane. In order to do that, we substitute the x of the plane''s equation by the value of the x in the line''s equation (as our x must be on the line AND on the plane): <=> n . (s + d * p) + D = 0 <=> - n . s - D = n . (d * p) <=> p = (- n .s - D) / (n . d) Et voilà, here we have the correct formula. The demonstration needs only the basic knowledge of dot product, vector, line and plane mathematics. Hope this is correct. It seems for me.
Lead programmer of the (slowly evolving) syBR game engine --- http://sybr.sourceforge.net
davepermen
davepermen
crossposting, doubleposting.. what ever you want:D

i dunno about that typo.. how about mailing it to him instead of posting it everywhere around, or what ever.. quite unpolite imho..

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
sebarnolds
sebarnolds
Hi !

Sorry if you think I''m unpolite but here is my point of view:
- I informed the author of it and he will correct his article when he will have time to
- I posted the corrections to several forums in order to have as many people informed of this as possible. Hey, this is the only tutorial about loading MAP and I believe that many people read it. I only want to help these people.

I didn''t mean to make crossposting but just to help people. This is the main idea of a forum: help others.

a+
Lead programmer of the (slowly evolving) syBR game engine --- http://sybr.sourceforge.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.