PDA

View Full Version : sprite particles and camera


twilightened
02-20-2008, 03:08 PM
Hi,

given a camera. A sprite particle system. I need that as the sprite particles travel towards the camera, that the size of the sprite particles remain constant as they travel. How is it possible.

BRgds,

kNish

ctp
02-20-2008, 05:18 PM
You can use something like this in your expressions:


float $camPos[] = `xform -q -translation camera1`;

vector $particlePos = position;

float $distance = mag((<<$camPos[0],$camPos[1],$camPos[2]>>) - (<<$particlePos.x,$particlePos.y,$particlePos.z>>));

spriteScaleXPP = spriteScaleYPP = $distance * 0.2;


Make sure to have added the spriteScaleXPP and spriteScaleYPP perParticle attributes.

twilightened
02-21-2008, 10:29 AM
Hi,

Thank you for your reply. It has been useful.


How is it possible to use a smoothstep in this function to get a curve formation as the sprite particles travel.

BRgds,

kNish

CGTalk Moderation
02-21-2008, 10:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.