Modelsunderray is driven ' me craz-ay 2004-03-25 - By Carl Welch
Back I've been trying to master terrain following for some time now. I've looked at just about every example on the web and in books that I can find. I just can't seem to get it to work for me.
The only model this modelunderray script CAN'T see is "terrain", the one that I want to get isectposition.z from and put it into the camera's transform.position.z I don't think thats to much to ask.
Terrain Following script:
targetpos = scene.model("target").getworldtransform().position modelsList = scene.modelsunderray(vector(targetpos.X, targetpos.Y, 100), vector(0,0,-1), #detailed) whichmodel = void
totalmodels = modelsList.count repeat with x = 1 to totalmodels put modelsList[x].model.name if modelsList[x].model.name = "terrain" then whichmodel = x exit repeat end if end repeat
if whichmodel <> void then vertb = modelsList[whichmodel].isectposition.z else vertb = 5 end if scene.model("target").transform.position.z = vertb
What concept am I not grasping to make this work?
--Carl
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|