Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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  
  [LWJGL] Cant Figure Out How To Do Frustum Culling  (Read 5205 times)
0 Members and 1 Guest are viewing this topic.
Offline Robo11

Junior Devvie


Medals: 1
Exp: 2 years



« Posted 2015-01-06 23:58:26 »

Hello JGO!

I need some help. I'm trying to implement frustum culling into my game but i cant seem to figure out how to do it.
Ive searched all around and cant find a any thing telling you how to do it. I understand you have to multiply your projection and model view matrices together, And then extract the frustum planes some how? I really don't know.

Thanks a bunch  Smiley
Offline Longarmx
« Reply #1 - Posted 2015-01-07 01:01:05 »

Libgdx has already implemented this for you. Just call camera.sphereInFrustum() (also works with points and other things) This will return your Boolean value.

Offline KudoDEV

JGO Ninja


Medals: 79
Exp: 6 years


Game Dev Hobbyist


« Reply #2 - Posted 2015-01-07 01:12:31 »

He's using LWJGL. I had issues with frustum culling as well. I would share my method but its riddled with odd code. (It's only temporary until I figure out a better way.)

Try this:
https://code.google.com/p/exemplwjgl/source/browse/trunk/src/fcampos/rawengine3D/graficos/Frustum.java?r=40

I learned a lot from that one

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Longarmx
« Reply #3 - Posted 2015-01-07 03:25:46 »

Whoops! I read Libgdx for some reason  Wink

Offline Robo11

Junior Devvie


Medals: 1
Exp: 2 years



« Reply #4 - Posted 2015-01-07 05:29:02 »

Thanks KudoDEV For the link! I tried to make a implementation using it, But the pointInFrustum() Method is always returning false.
Do you know whats wrong?

My Code: http://pastebin.java-gaming.org/8c3850c73171d

Thanks.
Offline Robo11

Junior Devvie


Medals: 1
Exp: 2 years



« Reply #5 - Posted 2015-01-07 06:03:05 »

Never mind, I found the mistake. Thank you vary much for your help!  Smiley
Offline ziozio
« Reply #6 - Posted 2015-01-07 07:14:12 »

I know you already have your answer but here is a good tutorial series on frustrum culling and the various collision algorithms

http://www.lighthouse3d.com/tutorials/view-frustum-culling/index/

A good read to find out what your culling algorithm and frustrum shape creation code is doing
Offline dominikremes

Junior Newbie





« Reply #7 - Posted 2018-01-13 14:28:05 »

And what was the problem Robo11?
Offline KaiHH

JGO Kernel


Medals: 520



« Reply #8 - Posted 2018-01-13 14:32:25 »

How likely do you think it is that, having not logged in for almost two years now, @Robo11 will remember even the problem he had over three years ago, let alone the solution? (rhetorical question)
Offline Zemlaynin

Senior Devvie


Medals: 12
Projects: 1



« Reply #9 - Posted 2018-03-06 07:34:14 »

I use org.joml.FrustumIntersection, very convenient.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SHC
« Reply #10 - Posted 2018-03-10 09:54:40 »

How likely do you think it is that, having not logged in for almost two years now, @Robo11 will remember even the problem he had over three years ago, let alone the solution? (rhetorical question)

Maybe he thought robots can remember everything........

Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (76 views)
2018-06-10 19:43:48

EgonOlsen (56 views)
2018-06-10 19:43:44

EgonOlsen (76 views)
2018-06-10 19:43:20

DesertCoockie (256 views)
2018-05-13 18:23:11

nelsongames (156 views)
2018-04-24 18:15:36

nelsongames (155 views)
2018-04-24 18:14:32

ivj94 (896 views)
2018-03-24 14:47:39

ivj94 (157 views)
2018-03-24 14:46:31

ivj94 (809 views)
2018-03-24 14:43:53

Solater (173 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-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
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!