LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: johnnyh on September 14, 2011, 20:58:46

Title: A noob question ?!
Post by: johnnyh on September 14, 2011, 20:58:46
Well I am sure this is very noob style but anyway, as I dont find the answer anywhere, I post it here.

I  dont understand one thing. lets suppose that you have a man in a 3D world (minecraft for example :)), if you say to the man to destroy a three in the 3D world, where are we going to store that information so that the loop doesnt call anymore the three ? Do we need a text file to store datas or what ?
Title: Re: A noob question ?!
Post by: broumbroum on September 14, 2011, 21:02:53
use a cache where the loop will ask for OBJECTS to be DRAWN. No tree at all. ;)
Title: Re: A noob question ?!
Post by: johnnyh on September 14, 2011, 21:05:17
a cache ? ok do u have an example of code which uses cache ? how do I call a cach ? any tutorial ?
Title: Re: A noob question ?!
Post by: Chuck on September 14, 2011, 22:49:44
Your render loop goes through a list of objects to draw.  When the tree is gone, you remove the tree from the list, and it won't be drawn.  That simple.

If you're asking where the code to manage that list goes, that's the stuff of entity and scenegraph management, and comprises a good chunk of code in any engine.  There's no single answer for that.





Title: Re: A noob question ?!
Post by: johnnyh on September 15, 2011, 05:59:41
Well I am noob and what you said is confusing me. Scenegraph management is an API, so you cant manage that with LWJGL ? What is entity? Would you have an example to show me ? or a tutorial ?
Title: Re: A noob question ?!
Post by: broumbroum on September 15, 2011, 08:47:28
You surely have to read the SaceInvaders tutorial, the demo is included in LWJGL http://www.cokeandcode.com/info/tut2d.html
Title: Re: A noob question ?!
Post by: johnnyh on September 15, 2011, 17:20:39
ok bro I am going to check that shit.

Cheers.