VelocityAttribute

From Odwiki

Jump to: navigation, search

Contents

What is the Velocity Attribute?

The Velocity Attribute (v attribute) is a GeometryAttribute which is of class Point and type Vector which describes the velocity of the point in seconds. POPs uses this value to simulate in which direction and at what speed each particle is headed. Mantra and RenderMan use this value to render the necessary MotionBlur. This is used in POPs for the speed and direction of particles and in SOPs for MotionBlur on deforming objects (like Characters).

Calculating and Manipulating the Velocity Attribute

Generating the value

This value is calculated automatically by the Particle System POPs. In SOPs, you may want to caculate this manually and you can use the TrailSOP set to Compute Velocity.

Manipulating the value

There might be a time that you wish to manually change the value of v - usually to acheive some special effect, like getting a specific image from MotionBlur. The trick here is remembering that the value is expressed per second and not per frame. For this you might want to use the $FPS global variable to manipulate this number.

You can easily change the value of v in the PointSOP>Particle tab>Velocity. This allows you to easily adust vx,vy and vz seperately.

So, for example, you want to create a vector to describe an object that must blur (or particle that must move) plus one unit in the x-axis, you can do this:

VX: 1 * $FPS
VY: 0
VZ: 0

Remember too that the camera's shutter speed defines the length of the blur too. By default this value is 0.5, so the shutter is open for half a frame. Your object will be blurred half a unit in x right now. You can either set your shutter to 1 or factor the shutter speed into the velocity calc:

VX: 1 * $FPS * (1/ch("/obj/cam1/shutter"))
VY: 0
VZ: 0

This is just an idea of how you must take in account the $FPS when manipulating v. You have created an object that is motion-blurred as if its moving fast, but the object is really dead still. Doing these kind of manipulation in a simuation context like POPs will cause the object to really move, but doing it in SOPs is an instantaneous/temporary change.

See Also

© 2009 od[force].net | advertise