03252007, 04:29 PM  #16 
User

Yes, tangents are not imported yet, and TCB (hermite) are converted into bezier controller. But i'll add tangents soon ;)
__________________Thanks for your help proposition, i haven't an internet connection at home yet, but i could ask you some questions on msn later. ;) 
Sponsored Links  Login to hide this ad! 

03252007, 07:54 PM  #17 
User
Respected User

Just in case, here's my code for Hermite and Bezier Interpolation, it calculates the points, tangents and everything. There's also a Quaternion library
__________________ JASS: library Angles struct EulerAngles real z real y real x static method Quat2Euler takes Quat q returns EulerAngles local EulerAngles Eu = EulerAngles.create() set Eu.x= Rad2Deg(Atan2(2*(q.x*q.w + q.y*q.z), 1  2*(q.y*q.y + q.x*q.x))) set Eu.y = Rad2Deg(Asin(2*(q.w*q.y  q.z*q.x))) set Eu.z = Rad2Deg(Atan2(2*(q.z*q.w + q.y*q.x) , 1  2*(q.y*q.y + q.z*q.z))) return Eu endmethod static method Euler2S takes EulerAngles Eu returns string return "{ " + R2S(Eu.x) + ", " + R2S(Eu.y) + ", " + R2S(Eu.z) + " }" endmethod endstruct struct Quat real w = 0. real z = 0. real y = 0. real x = 0. static method Euler2Quat takes EulerAngles Eu returns Quat local Quat q = Quat.create() local real x = Deg2Rad(Eu.x / 2) local real y = Deg2Rad(Eu.y / 2) local real z = Deg2Rad(Eu.z / 2) local real c1 = Cos(x) local real c2 = Cos(y) local real c3 = Cos(z) local real s1 = Sin(x) local real s2 = Sin(y) local real s3 = Sin(z) set q.w = c1 * c2 * c3 + s1 * s2 * s3 set q.x = s1 * c2 * c3  c1 * s2 * s3 set q.y = c1 * s2 * c3 + s1 * c2 * s3 set q.z = c1 * c2 * s3  s1 * s2 * c3 return q endmethod static method Quat2S takes Quat q returns string return "{ " + R2S(q.x) + ", " + R2S(q.y) + ", " + R2S(q.z) + ", " + R2S(q.w) + " }" endmethod method add takes Quat q2 returns nothing set this.x = this.x + q2.x set this.y = this.y + q2.y set this.z = this.z + q2.z set this.w = this.w + q2.w endmethod static method sum takes Quat q1, Quat q2 returns Quat local Quat Q = Quat.create() set Q.x = q1.x + q2.x set Q.y = q1.y + q2.y set Q.z = q1.z + q2.z set Q.w = q1.w + q2.w return Q endmethod method product takes Quat q2 returns nothing set this.x = this.x*q2.w + this.y*q2.z  this.z*q2.y + this.w*q2.x set this.y = this.x*q2.z + this.y*q2.w + this.z*q2.x + this.w*q2.y set this.z = this.x*q2.y  this.y*q2.x + this.z*q2.w + this.w*q2.z set this.w = this.x*q2.x  this.y*q2.y  this.z*q2.z + this.w*q2.w endmethod //Note: Quaternions aren't commutative, so on q1*q2 != q2*q1, but q1*q2 == q2*q1. static method productScalar takes Quat q1, Quat q2 returns Quat local Quat Q = Quat.create() set Q.x = q1.x*q2.w + q1.y*q2.z  q1.z*q2.y + q1.w*q2.x set Q.y = q1.x*q2.z + q1.y*q2.w + q1.z*q2.x + q1.w*q2.y set Q.z = q1.x*q2.y  q1.y*q2.x + q1.z*q2.w + q1.w*q2.z set Q.w = q1.x*q2.x  q1.y*q2.y  q1.z*q2.z + q1.w*q2.w return Q endmethod endstruct endlibrary library Interpolation type bezier3 extends location array [3] function Linear_Intp takes real a, real b, real t returns real return a + (b  a)*t endfunction function Bezier_Intp3 takes real a, real b, real c, real t returns real local real m = a + (b  a)*t local real n = b + (c  b)*t return m + (n  m)*t endfunction function Bezier_Intp3_Alt takes real a, real b, real c, real t returns real return a + 2*t*(ba) + t*t*(c  2*b + a) endfunction function Bezier_Intp4 takes real a, real b, real c, real d, real t returns real local real ab = a + (b  a)*t local real bc = b + (c  b)*t local real cd = c + (d  c)*t local real m = ab + (bc  ab)*t local real n = bc + (cd  bc)*t return m + (n  m)*t endfunction function Bezier_Intp4_Alt takes real a, real b, real c, real d, real t returns real local real m = t*t return a + 3*t*(b  a) + 3*m*(c  2*b + a) + m*t*(3*(bc) + d  a) endfunction function Bezier_Intp5 takes real a, real T1, real T2, real T3, real b, real t returns real local real ab = Linear_Intp(a,T1,t) local real bc = Linear_Intp(T1,T2,t) local real cd = Linear_Intp(T2,T3,t) local real dc = Linear_Intp(T3,b,t) local real i = Linear_Intp(ab,bc,t) local real j = Linear_Intp(bc,cd,t) local real k = Linear_Intp(cd,dc,t) local real m = Linear_Intp(i,j,t) local real n = Linear_Intp(j,i,t) return Linear_Intp(m,n,t) endfunction function Power takes real n, integer pow returns real if pow > 0 then return n*Power(n,pow1) endif return 1.0 endfunction function GetCardTan takes real p1, real p3 returns real return 0.5*(p3p1) endfunction // t = tension, c = continuety, b = bias // tension is how sharply the curve makes turns. // continuety specifies the rate of change between speed and direction. // bias specifies the direction of the curve. // sidenote: specify p1 as 0, when working with 2 points // sidenote2: for converting a 3dsmax TCB to a normal TCB you must use // MaxTCB2TCB function // the next function returns the intan of p2 function InTan takes real p1, real p2, real p3, real t, real c, real b returns real return (1t)*(1c)*(1+b)*(p2p1)/2 + (1t)*(1+c)*(1b)*(p3p2)/2 endfunction // the next function returns the outtan of p2 function OutTan takes real p1, real p2, real p3, real t, real c, real b returns real return (1t)*(1+c)*(1+b)*(p2p1)/2 + (1t)*(1c)*(1b)*(p3p2)/2 endfunction // element can be any TCB value, like tension. function MaxTcb2Tcb takes real element returns real return (element  25.0) / 25.0 endfunction function Hermite_Intp takes real p1, real p2, real t1, real t2, real s returns real local real s2 = s*s local real h1 = 8.0*s*s2  9.0*s2 local real h2 = h1*(1) local real h3 = s2*(s  2.0) + s local real h4 = s2*(s  1.0) set h1 = h1 + 1 return h1*p1 + h2*p2 + h3*t1 + h4*t2 endfunction endlibrary 
03252007, 08:43 PM  #19 
User
Join Date: Mar 2006
Posts: 24

Nice but, where finds 3dmax 5? I have start creat models but 3d max is out of my range... In google only 3dmax 8 and higer is. Cant someone give link to 3d max 5? Pliss... :(
__________________ 
03252007, 08:58 PM  #20 
♪♫
Modeling & Gallery Moderator

3ds max is not for download. And you can't find version 5 anywhere. If you missed it 34 years ago, tough luck.
__________________Last edited by TDR : 03252007 at 08:59 PM. 
03252007, 09:57 PM  #21 
User

Thanks Blinkboy, but 3dsMax already support quat and angles conversion, but i keep that in mind ... ;)
__________________ 
03262007, 12:48 AM  #22 
Dance puppet dance!
Join Date: Jul 2006
Posts: 252

OMG OMG OMG I cant get my 3dsmax to work but does this import anims AND the model? if it does I love you.
__________________ 
03262007, 03:10 PM  #23  
User
Join Date: May 2006
Posts: 35

Quote:
yeah it does! it worked fine for me i used the Furion modell. All worked fine thx a lot your the best!!!! but 3ds max 5 freezed for about 1 min to load the modell is that normal? (not that it freezes; i mean the time length) 

03262007, 03:31 PM  #24 
Free Software Terrorist
Technical Director

So far discreet should abandonware 3dsmax 5 haha... well there are still ways to get it though...
__________________ 
03262007, 08:17 PM  #25  
Dance puppet dance!
Join Date: Jul 2006
Posts: 252

Quote:
*cough* Vex's brother knows *cough* 

03312007, 05:59 PM  #27 
User

New version, first post updated =)
__________________ 
04032007, 07:11 AM  #28  
User
Join Date: Oct 2002
Posts: 342

Quote:
Tried importing a model with it into 3dsMax 9, that's the error that I got. Any way to work around it? 

04042007, 12:52 PM  #30 
I want my rep back! asap
Join Date: Jan 2006
Posts: 854

even if you can import it into version 9... why should you? art tools are only for 5 and you cant export again. and your not allowed to use blizz property in other games!
__________________ 
Thread Tools  Search this Thread 

