Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Intersection area

  1. #1
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    179

    Intersection area

    Hi

    I have a few objects in the scene - where I need to find their intersection with the floor - I can find the area and coordinates of the intersection of each object with the floor - what I need is to work out the total intersected area - bearing in mind that the objects can be moved around in the scene and their intersected areas may or may not overlap with each other - How do I implement this (may be using boolean operators? - I 'm not quite sure how though) Any ideas and sample code?

    Cheers

  2. #2
    Junior Member Newbie
    Join Date
    Dec 2001
    Posts
    12

    Re: Intersection area

    Intersection test is a quite huge chapter, maybe an nice example of intersection test would help you.
    Have a glance on this Nehe Tutorial, it includes balls moving around in a room intersecting with the walls and each others.
    http://nehe.gamedev.net/tutorials/lesson31.asp

    Hope this tut will help you.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    179

    Re: Intersection area

    Thanx - I 've had a look at the link - it's not quite what I need - I can find the coordinates of interesected area an object in the scene eg cube with the floor. All I need is to know is an easy way to find total intersected area of say three cubes overlap each other and also intersects with the floor - their intersecting area will also overlap - it is this area that I need to find out. There may also be cases when they don't overlap.

    any ideas

    cheers



    [This message has been edited by fox (edited 02-02-2002).]

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    562

    Re: Intersection area

    I'd be interested to know why you want to do this...

    The big question is what sort of performance you need. The obvious solution would be an image-space one: clear the screen to color A, set up an orthographic camera looking straight down at the floor and with a view volume big enough to contain all your objects, render your objects in colour B, then grab the contents of the framebuffer and count the number of B pixels.

    Won't be very fast though...

  5. #5
    Junior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sweden
    Posts
    130

    Re: Intersection area

    Couldnt you just calculate the volumes of the objects in worldspace and sum up the results subtracting it by the ground surface?

    Like this:

    Volume integral of Shape A + Volume integral of Shape B - Volume integral of Ground.

    (Im desperately trying to find my calculus book )

Posting Permissions

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