Article View: comp.graphics.algorithms
Article #55Re: BSP tree question
From: MNR F VAN DEN BERGH
Date: Fri, 08 Sep 1995 06:51
Date: Fri, 08 Sep 1995 06:51
28 lines
1808 bytes
1808 bytes
Tim Wendt (tim.wendt@daytonoh.ncr.com) wrote: : What is the test to determine if a vector is is front or behind the partition : vector (2D only ala Doom) when building a BSP tree? : I've read a few FAQs and articles but the only test I've seen in detail is the : test for 3D polygons (which is the dot product between the normal of the plane : a the polygon edge.) One of the texts did say it was a simple dot product : between the two 2D vectors. I pulled out the old linear algebra textbook but : I'm still confused. The dot product was described as ||u|| ||v|| cos (angle : between the vectors). How do I find the angle between the two vectors? Is : this the easiest approach? Thanks much! : Tim Well, the point usually is to calculate the cosine of the angle between the vectors and not the other way round. By definition: a = (a1, a2, a3) ; b = (b1, b2, b3) Then a dot b = (a1*b1 + a2*b2 + a3*b3) = |a|*|b|*cos(angle) You can get a and b using 3 3d points, ie a = x3-x2; b = x1-x2; (where xn's are 3d-vectors) That's about it. -- ttfn Frans van den Bergh (s9506131@cosine.cs.up.ac.za) ------------------------------------------------------------------- The only instruction still missing from the Pentium is db 66h, 90h !
Technical Details
Message-ID:
<42op5a$1buc@inet.up.ac.za>Path:
arc1-ca.pugleaf.net!inet.up.ac.za!jupiter!s9506131References:
<DE70Io.AG6@corsair.daytonoh.attgis.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!inet.up.ac.za!jupiter!s9506131 From: s9506131@jupiter.up.ac.za (MNR F VAN DEN BERGH) Newsgroups: comp.graphics.algorithms,comp.sys.amiga.programmer,rec.games.programmer Subject: Re: BSP tree question Followup-To: comp.graphics.algorithms,comp.sys.amiga.programmer,rec.games.programmer Date: 8 Sep 1995 06:51:22 GMT Organization: University of Pretoria Message-ID: <42op5a$1buc@inet.up.ac.za> References: <DE70Io.AG6@corsair.daytonoh.attgis.com> NNTP-Posting-Host: jupiter.cs.up.ac.za X-Newsreader: TIN [version 1.2 PL2]