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

Senior Devvie

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.
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.
cylab

JGO Ninja

Medals: 55

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

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

Mathias - I Know What [you] Did Last Summer!
princec

« JGO Spiffy Duke »

Medals: 422
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

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

Well, this is jolly excellent

Cas

Epitaph64

Junior Devvie

Projects: 1

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

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

markmistry

Junior Devvie

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

Went over my head too, show off  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.
 trollwarrior1 (34 views) 2014-11-22 12:13:56 xFryIx (73 views) 2014-11-13 12:34:49 digdugdiggy (52 views) 2014-11-12 21:11:50 digdugdiggy (46 views) 2014-11-12 21:10:15 digdugdiggy (40 views) 2014-11-12 21:09:33 kovacsa (66 views) 2014-11-07 19:57:14 TehJavaDev (70 views) 2014-11-03 22:04:50 BurntPizza (68 views) 2014-11-03 18:54:52 moogie (83 views) 2014-11-03 06:22:04 CopyableCougar4 (82 views) 2014-11-01 23:36:41
 basil_ 29x theagentd 28x HeroesGraveDev 25x BurntPizza 20x Riven 19x Spasi 19x KevinWorkman 15x princec 14x SHC 12x Gibbo3771 11x gouessej 11x CopyableCougar4 10x kpars 10x LiquidNitrogen 10x Nate 9x Grunnt 9x
 Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27Resources for WIP games2014-08-01 16:20:17Resources for WIP games2014-08-01 16:19:50List of Learning Resources2014-07-31 16:29:50List of Learning Resources2014-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