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

clicking and Dragging models around a terrain

2003-12-17       - By Alex da Franca

 Back
Reply:     1     2     3  

if I understand correctly you want z to be the fixed Up vector.
since you do not want to move vertically (which
in my code is clumsy anyway...), you can simplify
the exitframe handler to:

on exitframe me
  if ilk(pModel) = #model then

    shift = the shiftdown
    camPos = pCam.worldposition

    fixedAxis = 3      -- 3 = z-axis; 2 = y-axis and 1 = x-axis

    vHeight = pModel.worldposition[fixedAxis]

    p = pCam.spriteSpaceToWorldSpace((the mouseLoc - pLeftTop - pOffset))

    v = p - camPos
    v.normalize()

    if v[fixedAxis] <> 0 then -- if the vector is
parallel to the x-y plane we can't divide by 0
      f = (p[fixedAxis] - vHeight) / v[fixedAxis]
      pModel.worldposition = p - (v * f)
    end if
  end if

end


maybe you want to try to put it in the enterframe
handler instead of exitframe, because it runs
smoother then.
--

  |||
a�ex
 --

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