Particle Orientation

I'm trying to find a way to orient a facing card in a particle system to be always facing camera but be orientated to be parallel to the camera as well. So the bottom and top edge of the facing card matches that of the camera.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

Hope this help

pfSys = ($PF_Source_001)
count = pfSys.NumParticles()
theTarget = $Camera001  -- the target
for p = 1 to count do
(		
	local dum = dummy()
	pfSys.particleIndex = p
 	pPos = pfSys.particlePosition  --get particle pos
	tm = matrixfromnormal theTarget.dir --get the camera matrix3
	new_TM = matrix3 tm.row1 tm.row2 tm.row3 pPos
	dum.transform = pfSys.particleTM = new_TM
)

barigazy

JokerMartini's picture

SOLUTION

    on ChannelsUsed pCont do
    (
    pCont.useTime = true
    pCont.useSpeed = true
    pCont.useTM = true
    pCont.usePosition = true
    )
 
    on Init pCont do 
    (
 
    )
 
    on Proceed pCont do 
    (
    count = pCont.NumParticles()
    source = $Camera001
    for i in 1 to count do
    (
    pCont.particleIndex = i
    tm = source.transform
    pos = pCont.particlePosition
    new_TM = matrix3 tm.row1 tm.row2 tm.row3 pos
    pCont.particleTM = new_TM
    )
    )

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

barigazy's picture

Maybe

I think is better to use
matrixfromnormal source.dir
then
source.transform

barigazy

JokerMartini's picture

I essentially want the

I essentially want the particles to act as if they had an Orientation constraint on them so that they are always facing camera but also have the rotation to be parallel on all sides to match that of the camera.

I tried this but its way to intense to do on large particle counts and actually doesn't orient the particles correctly.

pfSys = ($PF_Source_001)
count = pfSys.NumParticles()
for p = 1 to count do
(		
	local dum = dummy()
	local theTarget = $Camera001  -- the target
 
 
	pfSys.particleIndex = p
 	pPos = pfSys.particlePosition  --get particle pos
	tm = theTarget.transform --get the camera matrix3
	new_TM = matrix3 tm.row1 tm.row2 tm.row3 pPos
 
	pfSys.particleTM = new_TM
)

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

barigazy's picture

Please, screenshoots if you

Please, screenshoots if you don't mind.

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.