Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
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 5924 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: 650



« 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
« 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  
 
 

 
hadezbladez (349 views)
2018-11-16 13:46:03

hadezbladez (183 views)
2018-11-16 13:41:33

hadezbladez (348 views)
2018-11-16 13:35:35

hadezbladez (84 views)
2018-11-16 13:32:03

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

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

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

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

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

nelsongames (2308 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!