Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (564) Games in Android Showcase (151) games submitted by our members Games in WIP (605) 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 4839 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: 78

 « 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: 492
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.

 theagentd (9 views) 2015-03-27 23:08:20 wxwsk8er (52 views) 2015-03-20 15:39:46 Fairy Tailz (43 views) 2015-03-15 21:52:20 Olo (28 views) 2015-03-13 17:51:59 Olo (30 views) 2015-03-13 17:50:51 Olo (35 views) 2015-03-13 17:50:16 Olo (40 views) 2015-03-13 17:47:07 ClaasJG (30 views) 2015-03-10 11:36:42 ClaasJG (39 views) 2015-03-10 11:33:01 Pippogeek (47 views) 2015-03-05 14:36:23
 LiquidNitrogen 23x KevinWorkman 21x BurntPizza 21x basil_ 20x Riven 18x EgonOlsen 17x theagentd 16x Roquen 13x princec 12x Varkas 10x SHC 9x NegativeZero 9x ClaasJG 7x teletubo 7x Ecumene 7x nsigma 7x
 How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding 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:27
 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