Java-Gaming.org Hi !
 Featured games (88) games approved by the League of Dukes Games in Showcase (681) Games in Android Showcase (196) games submitted by our members Games in WIP (744) 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 5338 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 Wizard

Medals: 135

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

 Hydroque (43 views) 2016-06-22 02:17:53 SwampChicken (45 views) 2016-06-20 13:22:57 SwampChicken (44 views) 2016-06-20 13:22:49 SwampChicken (38 views) 2016-06-20 13:22:26 Hydroque (80 views) 2016-06-15 08:22:50 Hydroque (72 views) 2016-06-13 06:40:55 DarkCart (192 views) 2016-05-29 02:30:33 Hydroque (160 views) 2016-05-26 14:45:46 Mac70 (168 views) 2016-05-24 21:16:33 theagentd (151 views) 2016-05-14 18:38:35
 theagentd 42x Spasi 41x NegativeZero 38x KaiHH 31x princec 27x LiquidNitrogen 23x ags1 19x h.pernpeintner 13x ra4king 12x kingroka123 10x CoDi^R 10x purenickery 10x Hydroque 8x Opiop 8x DarkCart 8x Ecumene 7x
 Java Data structures2016-06-13 21:22:09Java Data structures2016-06-13 21:20:42FPS Camera Tutorialby Hydroque2016-05-22 05:40:58Website offering 3D Models specifically for games for freeby vusman2016-05-18 17:23:09Website offering 3D Models specifically for games for freeby vusman2016-05-09 08:50:56Website offering 3D Models specifically for games for freeby vusman2016-05-06 11:10:21Website offering 3D Models specifically for games for freeby vusman2016-04-29 12:56:17List of Learning Resources2016-02-05 09:39:47
 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