Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Volume/plane intersection  (Read 4657 times)
0 Members and 1 Guest are viewing this topic.
Offline ryanm

Senior Duke


Projects: 1
Exp: 15 years


Used to be bleb


« Posted 2009-02-21 11:45:02 »

It started life as a solution to this frustum culling problem. I don't normally come up with anything this clever, so one thing lead to another and now I've got an efficient generalised volume/plane intersection finding utility on my hands. It handles non-convex volumes and the intersection polygon vertices are returned in order. I've got no use for it, so here you go:

Subclass IntersectionVolume to define a particular topography (number of vertices, edges between vertices, faces bound by edges). Have a look at Box, Tetrahedron and Dipyramid for examples of this. Betraying its genesis, Box has a method to set its vertices from view frustum planes.
Set the vertex positions as required (bear in mind that faces have to be convex polygons), and you're ready to go. There are methods to find the intersection polygons with x, y and z planes, or you can query on an arbitrary plane at the minimal additional cost of a dot-product per vertex.



Have a play with it with this webstart. 1-4 to change the query volume, q and w to alter the number of queries, a s and d to control the scan speed, left-button drag to rotate the view and right-button drag to rotate the query planes.
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #1 - Posted 2009-02-21 11:58:39 »

I am not as smart as oyu so I have no idea waht that was about. But the webstart looked really cool.
Offline cylab

JGO Ninja


Medals: 52



« Reply #2 - Posted 2009-02-21 12:00:51 »

This sure will become handy - thank you very much for sharing this!!!  Cheesy

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 405
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2009-02-22 16:58:34 »

Well, this is jolly excellent Smiley

Cas Smiley

Offline Epitaph64

Junior Duke


Projects: 1



« Reply #4 - Posted 2009-06-01 05:51:31 »

You left out number 5, which is also quite entertaining to watch.

Offline markmistry

Junior Duke





« Reply #5 - Posted 2009-06-01 06:07:36 »

Went over my head too, show off  Tongue I suppose in a few more years i might understand what bleb was going on about. lol
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!