dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Determining the grids cut by a plane,formed from 3 vertices

  1. #1
    Join Date
    Dec 2017
    Posts
    1

    Determining the grids cut by a plane,formed from 3 vertices

    Hi,

    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.

  2. #2
    Join Date
    Feb 2017
    Posts
    343

    Re: Determining the grids cut by a plane,formed from 3 vertices

    Quote Originally Posted by Exploring_Programmin View Post
    any other simple approach.
    These kinds of intersection tests are very common in graphics computing. There's a book called Real-Time Rendering by Akenine-Möller and others, third edition. I found an algorithm in that book on page 755 called PlaneAABBIntersect. It looks very efficient to me.

    When I searched for it on the net fortunately most of the relevant text (16.10 Plane/Box Detection) showed up about here,

    https://books.google.se/books?id=Xcb...016.10&f=false

    Parts of the text aren't shown so if you have questions please feel free to ask and I'll try to locate the answers in my book.
    Last edited by wolle; December 23rd, 2017 at 05:01 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)