www.BinaryAlchemy.de :: View topic - about the event script in Pt grad dust example
 SearchSearch   RegisterRegister  ProfileProfile   UsergroupsUsergroups   Log inLog in 
If you create a new post, please use a topic that describes your problem
Documento sin título
 
about the event script in Pt grad dust example

 
Post new topic   Reply to topic    www.BinaryAlchemy.de Forum Index -> Shader Questions / Comments
View previous topic :: View next topic  
Author Message

suntemple



Joined: 30 Nov 2006
Posts: 4

PostPosted: Thu Nov 30, 2006 8:47 pm    Post subject: about the event script in Pt grad dust example Reply with quote

Just purchased the volume shaders and I can say with much glee that they make particles in XSI 200% more fun and flexible! Iam really excited about using these volumes!

Had a question about the script found in the example scene "PT gradient dust occlusion"

Basically, what does this script do? It seems to dictate particle life based particle rotation but not sure as I am not very experienced in scripting. Hoping for someone to break down/explain the code-if anyone has time it would help very much. (particle event script)
-James.

set PT_vel =inParticle.velocity
set PT_rot =inParticle.rotation
PT_vel.NormalizeInPlace

set tmpVect1 = XSIMath.CreateVector3
set tmpVect2 = XSIMath.CreateVector3
set polyNormal = XSIMath.CreateVector3
set verticalVect = XSIMath.CreateVector3
set polyMatrix = XSIMath.CreateMatrix3
verticalVect.set PT_vel.x, PT_vel.y ,PT_vel.z
polyNormal.set 0,1,0

tmpVect1.cross polyNormal,verticalVect
tmpVect2.cross tmpVect1,polyNormal
tmpVect1.normalizeInPlace
tmpVect2.normalizeInPlace
polyNormal.normalizeInPlace
polyMatrix.set tmpVect1.x, tmpVect1.y, tmpVect1.z,_
polyNormal.x, polyNormal.y, polyNormal.z,_
tmpVect2.x, tmpVect2.y, tmpVect2.z

set rot =XSIMath.CreateRotation
rot.SetFromMatrix3 polyMatrix

rot.GetXYZAngles PT_rot
inParticle.rotation=PT_rot
Back to top
View user's profile Send private message

schoenberger
Site Admin


Joined: 02 Mar 2005
Posts: 3785

PostPosted: Thu Nov 30, 2006 11:46 pm    Post subject: Reply with quote

It controls the orientation of the particle.
It is a "simple" up-vector script.
This way the particles are not rotating in every direction.
The rotation axis is parallel to the ground, the particles are "rolling" over the ground.
Just disable the event and you will see the difference in your shaded view.
_________________
Holger Schönberger
Binary Alchemy - digital materialization
Back to top
View user's profile Send private message Send e-mail

suntemple



Joined: 30 Nov 2006
Posts: 4

PostPosted: Tue Dec 05, 2006 9:17 pm    Post subject: Reply with quote

Holger,
thanks for explaining the script-makes sense now. I've had a bit more time to experiment with the shaders and I must say they are the best thing to happen to XSI particles. I have more questions but I ll post a new thread.
Thanks again,
James.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.BinaryAlchemy.de Forum Index -> Shader Questions / Comments All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 
Documento sin título
 



Powered by phpBB © 2001, 2002 phpBB Group



Number of shameful bots caught by Anti-Spam ACP: 1667