Java-Gaming.org Hi !
 Featured games (91) games approved by the League of Dukes Games in Showcase (756) Games in Android Showcase (229) games submitted by our members Games in WIP (842) 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 6397 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 Kernel

Medals: 180

 « 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: 1030
Projects: 3
Exp: 20 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

 DesertCoockie (52 views) 2018-05-13 18:23:11 nelsongames (83 views) 2018-04-24 18:15:36 nelsongames (74 views) 2018-04-24 18:14:32 ivj94 (759 views) 2018-03-24 14:47:39 ivj94 (87 views) 2018-03-24 14:46:31 ivj94 (643 views) 2018-03-24 14:43:53 Solater (102 views) 2018-03-17 05:04:08 nelsongames (184 views) 2018-03-05 17:56:34 Gornova (426 views) 2018-03-02 22:15:33 buddyBro (1086 views) 2018-02-28 16:59:18
 Java Gaming Resourcesby philfrei2017-12-05 19:38:37Java Gaming Resourcesby philfrei2017-12-05 19:37:39Java Gaming Resourcesby philfrei2017-12-05 19:36:10Java Gaming Resourcesby philfrei2017-12-05 19:33:10List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05
 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