Making trees vanish/appear

aprice2704

08-11-2008 09:08:49

Hi all,

I am using PG and it is working beautifully with code::blocks, mingw etc.

It displays 100k trees very well and generally is a magnificent piece of software -- very easy to add in etc. Nice work JohnJ and team!!

To show the impact of a certain percentage of trees in a forest being harvested I would like to make particular chosen trees appear and disappear on command (or indeed all of them). Is there a way to do this, or can someone suggest how I might alter the source code to do so?

Thanks again for a great system

Andy

JohnJ

08-11-2008 20:38:50

You might want to take a look at PagedGeometry Example 5 - "Dynamic Trees". This shows how to dynamically add and remove trees from the scene. Basically you can use TreeLoader2D/TreeLoader3D's addTree() and deleteTrees() to add and delete trees, and optionally use getTrees() to iterate through existing trees.

There are other ways to do this also. For example you could write your own tree management system by implementing a custom PageLoader class like TreeLoader2D/TreeLoader3D for full control.

aprice2704

15-11-2008 03:54:10

the title of the example somehow and so did not investigate it. :)