Vue Animated EcoSystem Following Terrain Contours Script | |
What the script does:
Moves animated figures in an EcoSystem across a terrain, taking terrain altitudes and instance scales into account. Currently (28th March 2005) the script only works with figures moving exactly North South i.e. from the edge of the terrain furthest back in the Vue scene toward the front.
Updated version posted April 1st 2005.
N.B. In this, and the previous version, the
scale value used is that entered in the population list on the "General" tab
of the material editor, not the "Overall Scaling" slider on the "Scaling & Orientation"
tab which should be left at 1.00 for the script to function correctly. First off assess how far the full scale figure
to be used in the EcoSystem travels per second, in Vue logical units. This
is needed to correctly synchronise the figures' strides with ground covered.
N.B. Figures used in the EcoSystem must NOT have an animation path.
|
1250 "Judy Casual" Poser figures on a standard terrain Vue 5 Infinite and Poser 5. February 2005. |
1500 Poser 'bots on a procedural terrain Vue 6 Infinite and Poser 5, composited and added "death rays" in Debugmode Wax. C. 2006? |
|
1600 Poser 'bots on a procedural terrain Vue 7 Infinite and Poser 7. March 2009 The strange flick of the robots' right arms in this clip is courtesy of the Poser Walk Designer. |
|
Vue EcoSystem 'Follow My Leader' Script | |
What the script does:
Allows an animated object to be used as a 'leader' for EcoSystem instances. The eco instances mimic the translations and rotations of the 'leader' object. The script does not follow terrain contours, it is intended for flocks of birds or fleets of spaceship sims. The EcoSystem can be on any type of object, and the instances will retain their original relative positions. There is no need to keep the leader within the bounds of the base object, the Eco is used here simply to create instances and distribution patterns. 23/06/05 - Updated to kill 'global already referenced' warning.
N.B. Not currently compatible with HyperVue as it can't be used as a startup script.
#file = Leader.py #John Whitham (me@jwhitham.plus.com) 2005 lastpos = None lobj = None fobj = None leader = Prompt("Enter the name of the object to be followed.", \ "",false,"Enter Leader Name") follower = Prompt("Enter the name of the object with the follower Eco", \ "",false,"Enter Eco Object") def BirdFlock(k): Eco = GetEcosystemOnObject(fobj) rot = lobj.GetRotationAngles() newpos = lobj.Position() xdiff = newpos[0] - lastpos[0] ydiff = newpos[1] - lastpos[1] zdiff = newpos[2] - lastpos[2] for boid in range(0,Eco.GetInstanceCount()): Eco.SetInstanceRotationV(boid,rot) if (CurrentFrame() > 0): Eco.MoveInstance(boid,xdiff,ydiff,zdiff) global lastpos lastpos = newpos if (ObjectByName(leader)!=None and ObjectByName(follower)!=None): lobj = ObjectByName(leader) lastpos = lobj.Position() fobj = ObjectByName(follower) fobj.SetInitFrameCallback(BirdFlock) else: Message("Wrong","Try Again",1) |
It Came From the Starbucks!!!! An alien flying (cup and) saucer invasion threatens Earth! Vue 5 Infinite. February 2005 |
Vue EcoSystem 'Follow My Leader 1' Script | |
What the script does:
As per the above, but the follower object must be a terrain, and
the eco instances follow the terrain contours. N.B. Not currently compatible with HyperVue as it can't be used as a startup script. Code (copy and paste):
#File Leader1.py #John Whitham (me@jwhitham.plus.com) 2005 lastpos = None lobj = None fobj = None eco_offset = 0.0 def SetOffset(): eco = GetEcosystemOnObject(fobj) pos = eco.GetInstancePosition(0) alt = GetAltitudeOnEcosystemAt(eco,pos[0],pos[1]) global eco_offset eco_offset = pos[2] - alt def BirdFlock(k): eco = GetEcosystemOnObject(fobj) rot = lobj.GetRotationAngles() newpos = lobj.Position() global lastpos xdiff = newpos[0] - lastpos[0] ydiff = newpos[1] - lastpos[1] lastpos = newpos for boid in range(0,eco.GetInstanceCount()): fname = eco.GetInstanceFilename(boid) if (fname.endswith("Rocks.prv")): eco.SetInstanceRotationV(boid,rot) if (CurrentFrame()>0): eco.MoveInstance(boid,xdiff,ydiff,0) pos = eco.GetInstancePosition(boid) alt = GetAltitudeOnEcosystemAt(eco,pos[0],pos[1]) zpos = alt + eco_offset eco.SetInstancePosition(boid,pos[0],pos[1],zpos) leader = Prompt("Enter the name of the object to be followed.", \ "",false,"Enter Leader Name") follower = Prompt("Enter the name of the object with the follower Eco", \ "",false,"Enter Eco Object") if (ObjectByName(leader)!=None and ObjectByName(follower)!=None): lobj = ObjectByName(leader) lastpos = lobj.Position() fobj = ObjectByName(follower) SetOffset() fobj.SetInitFrameCallback(BirdFlock) else: Message("Wrong","Try Again",1) |