Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Subject: Cameras
Subject: scaleDown command
Subject: black out solved
Subject: Aircraft Tutorial
Subject: Mathematical XYZ ?
Subject: Re: Its done This vs That
Subject: Re: Its done first week
recommendations for screen video captures?
Subject: 3DExplorer "Oddity "
Subject: Re: New Director
Subject: ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
Subject: RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Subject: Re: Texturing
Big Break Contest Videos
Subject: New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Subject: Plasma?
Looking for Inspiration
Subject: Weird EMail Q
Subject: Re: It 's done first week ?
Subject: Cherry not cranberry
Subject: Re: New game
Camera Animation Problem
Subject: Particle plugins?
 
Modelsunderray is driven ' me craz-ay

Modelsunderray is driven ' me craz-ay

2004-03-25       - By Allen Partridge

 Back
Reply:     1     2     3     4     5     6     7     8     9  

Assuming that the world orientation is Z up and not y up, this should
cast a ray straight down. My first guess, given that it's terrain, is
that you are in fact in a Y up world and casting your ray out toward
camera rather than downward. Esp. given it's inclination to see other
models.

If you really only care about terrain, remove the other models from the
world before you cast the ray -- it will increase the speed
substantially if you have a lot of models in the world. Then cast your
ray and count on the result being the terrain or a total failure.

--al
-- --Original Message-- --
From: dir3d-l-bounces@(protected)
[mailto:dir3d-l-bounces@(protected)] On Behalf Of Carl Welch
Sent: Thursday, March 25, 2004 8:52 PM
To: dir3d-l@(protected)
Subject: [Dir3d-l] Modelsunderray is driven' me craz-ay

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

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Dir3d-l mailing list
Dir3d-l@(protected)
http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l