Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / orientate a dummy to a spline vertex
  RSS 2.0 ATOM  

orientate a dummy to a spline vertex
Rate this thread
 
37629
 
Permlink of this thread  
avatar
  • CG_Pappy
  • Posted: 10 December 2009 03:08 AM
  • Location: Otley, West Yorkshire
  • Total Posts: 12
  • Joined: 18 November 2008 06:15 PM

I am trying to use a rotation script to orientate a dummy to a vertex within a spline.

I can easily get the dummy to follow the vertex by using this position script -

pos getKnotPoint $Spline01 6 3

I have tried various ways to get the vector from the inVec and outVec positions from the spline but it doesn’t seem to work!

Here’s what I am trying -

inVec getinVec $Spline01 6 3
outVec 
getoutVec $Spline01 6 3
averageVec 
(inVec+outVec)*0.5
angleVec 
acos (dot (normalize(getinVec $Spline01 6 3)) (normalize(getoutVec $Spline01 6 3)))
rot 
quat averageVec.x averageVec.y averageVec.z angleVec

Anyone got any ideas? Any help would be apreciated.

I am using max9 32bit.



Replies: 0