<![CDATA[CodeGuru Forums - Algorithms & Data Structures]]>
http://forums.codeguru.com/
enTue, 16 Jan 2018 23:13:31 GMTvBulletin60http://forums.codeguru.com/images/misc/rss.png<![CDATA[CodeGuru Forums - Algorithms & Data Structures]]>
http://forums.codeguru.com/
Determining the grids cut by a plane,formed from 3 vertices
http://forums.codeguru.com/showthread.php?560793-Determining-the-grids-cut-by-a-plane-formed-from-3-vertices&goto=newpost
Fri, 22 Dec 2017 09:51:36 GMTHi,
I found out an equation of a plane,from three vertices. Now,if I have a bounding box(i.e. a large cube),How can I determine the grid positions(small cubes),where the plane cuts the large cube.
I am currently following this approach:
For each small cube center, say(Xp, Yp, Zp), calculate perpendicular distance to the plane i.e., (aXp + bYp + c*Zp + d)/ (SquareRoot Of (a^2 + b^2 + c^2)). This should be less than or equal to (length of smallCube * SquareRoot(3))/2. If this criteria,gets satisfied,then I assume my plane to cut the large cube at this small cube position.
a,b,c,d are coefficients of the plane,of the form ax+by+cz+d = 0.
I would be really glad,if someone can let me know,if I am doing something wrong (or) also,any other simple approach.Exploring_Programminhttp://forums.codeguru.com/showthread.php?560793-Determining-the-grids-cut-by-a-plane-formed-from-3-vertices