Bergice,
Quote: "//dont need our base tree anymore
delete object treeMDL"
You can't delete the original object which has been instanced without losing all of the instances. Whatever happens to the original happens to all of the objects instanced from it.
set display mode 1024, 768, 32
sync on : sync rate 0 : sync
make object sphere 1, 1.0
for ObjectNumber = 2 to 50
Direction# = -30.0 + rnd(60)
Elevation# = -20.0 + rnd(40)
Distance# = 10.0 + rnd(40)
instance object ObjectNumber, 1
turn object right ObjectNumber, Direction#
pitch object up ObjectNumber, Elevation#
move object ObjectNumber, Distance#
next Counter
do
if TestFlag = 0
if returnkey()
delete object 1
TestFlag = 1
endif
text 20, 20, "Press the Enter key to delete the original object."
else
text 20, 20, "The original object has been deleted. Press Escape to end."
endif
sync
loop
end
As far as I know, the only variations in instanced objects can be in position, rotation and scale.
Quote: "//Not sure if instance object or clone object is best."
In this case, instancing is best. Except for position, rotation and scale, the trees will all be the same (although you could instance a couple of different models for variety). Instancing requires substantially fewer system resources, as there’s only one set of object data in memory regardless of the number of instances. All of the instanced objects share the object data of the original. This has the additional benefit that you only need to animate the original object in order to animate all of them (in this case, having the branches move to simulate the wind, perhaps).
Cloning is required if you need some other variation between the objects, as each clone is a new and separate object unrelated to the original. Each cloned object has its own complete set of object data thus requiring greater system resources. This being the case, you can delete the original object and not lose the objects cloned from it. And you can make changes to individual clones or apply individual animations to them. Therefore, cloning gives greater flexibility than instancing.
Ten minutes to Wapner.