  | | | Particle rotation event script.... | Particle rotation event script.... 2004-03-10 - By Dan Yargici
Back Thanks Kim. Yeah, I can reset the X and Z rotation fine but I still want the Y rotation to be aligned to the velocity. I'm using VBScript.
PartRot = inParticlecloud.particles.RotationArray myBound = ubound(PartRot,2)
for p = 0 to myBound PartRot (0,p) = 0 PartRot (2,p) = 0 next
inParticlecloud.particles.rotationarray = PartRot
If I run this with 'Align on Velocity' activated my particles go completely psycho! I think I'll need to calculate their rotation from their velocity vectors but I just wouldn't know where to begin there....
DAN
-- -- Original Message -- -- From: kim aldis To: XSI@(protected) Sent: Wednesday, March 10, 2004 6:36 PM Subject: RE: Particle rotation event script....
it should work, Dan. Although if you're doing it in jscript there are some problems with re-assigning the arrays at the end of the loop. I used a cloud -based script and just looped through the particles, setting the rotations as I needed them. Worked pretty well for faking patch deforms and still getting the orientation right.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf Of Dan Yargici Sent: 10 March 2004 16:03 To: XSI@(protected) Subject: Particle rotation event script....
I have a particle cloud with a bunch of instanced characters and their rotation is set to 'align on velocity' but I would only like this to affect Y rotation. I thought I might be able to take in the rotationarray for the cloud and set the x and z rotation back to 0 on every frame but it seems the align on velocity is applied after the script event, thus cancelling it out.
So the question is... how can I reset these or how can I derive my own Y rotation from the velocity? I'm not much of a maths head ( I was once, honest! ) so any help would be greatly appreciated.
DAN <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1400" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Thanks Kim. Yeah, I can reset the X and Z rotation fine but I still want the Y rotation to be aligned to the velocity. I'm using VBScript.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2>PartRot = inParticlecloud.particles.RotationArray</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2>myBound = ubound(PartRot,2)</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2>for p = 0 to myBound</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2> PartRot (0,p) = 0<BR> PartRot (2,p) = 0</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2>next</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2>inParticlecloud.particles.rotationarray = PartRot</FONT></DIV><FONT face=Arial size=2> <DIV><BR>If I run this with 'Align on Velocity' activated my particles go completely psycho! I think I'll need to calculate their rotation from their velocity vectors but I just wouldn't know where to begin there....</DIV> <DIV> </DIV> <DIV>DAN</DIV> <DIV></FONT><FONT face=Arial size=2> </DIV></FONT> <BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=kim@(protected) href="mailto:kim@(protected)">kim aldis</A> </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A title=XSI@(protected) href="mailto:XSI@(protected)">XSI@(protected)</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, March 10, 2004 6:36 PM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: Particle rotation event script....</DIV> <DIV><BR></DIV> <DIV dir=ltr align=left><SPAN class=171583316-10032004><FONT face=Arial color=#008080 size=2>it should work, Dan. Although if you're doing it in jscript there are some problems with re-assigning the arrays at the end of the loop. I used a cloud-based script and just looped through the particles, setting the rotations as I needed them. Worked pretty well for faking patch deforms and still getting the orientation right.</FONT></SPAN></DIV><BR> <BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left> <HR tabIndex=-1> <FONT face=Tahoma size=2><B>From:</B> owner-xsi@(protected) [mailto:owner-xsi@(protected)] <B>On Behalf Of </B>Dan Yargici<BR><B>Sent:</B> 10 March 2004 16:03<BR><B>To:</B> XSI@(protected)<BR><B>Subject:</B> Particle rotation event script....<BR></FONT><BR></DIV> <DIV></DIV> <DIV><FONT face=Arial size=2>I have a particle cloud with a bunch of instanced characters and their rotation is set to 'align on velocity' but I would only like this to affect Y rotation. I thought I might be able to take in the rotationarray for the cloud and set the x and z rotation back to 0 on every frame but it seems the align on velocity is applied after the script event, thus cancelling it out.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>So the question is... how can I reset these or how can I derive my own Y rotation from the velocity? I'm not much of a maths head ( I was once, honest! ) so any help would be greatly appreciated.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>DAN</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
|
|
 |