Home | Trees | Indices | Help |
|
---|
|
This module can be used to generate noise of various types. This can be used for terrain generation, to create textures, make animations more 'animated', object deformation, etc. As an example, this code segment when scriptlinked to a framechanged event, will make the camera sway randomly about, by changing parameters this can look like anything from an earthquake to a very nervous or maybe even drunk cameraman... (the camera needs an ipo with at least one Loc & Rot key for this to work!):
Example:from Blender import Get, Scene, Noise #################################################### # This controls jitter speed sl = 0.025 # This controls the amount of position jitter sp = 0.1 # This controls the amount of rotation jitter sr = 0.25 #################################################### time = Get('curtime') ob = Scene.GetCurrent().getCurrentCamera() ps = (sl*time, sl*time, sl*time) # To add jitter only when the camera moves, use this next line instead #ps = (sl*ob.LocX, sl*ob.LocY, sl*ob.LocZ) rv = Noise.vTurbulence(ps, 3, 0, Noise.NoiseTypes.NEWPERLIN) ob.dloc = (sp*rv[0], sp*rv[1], sp*rv[2]) ob.drot = (sr*rv[0], sr*rv[1], sr*rv[2])
Functions | |||
float |
|
||
3-float list |
|
||
|
|||
float |
|
||
3-float list |
|
||
float |
|
||
|
|||
float |
|
||
float |
|
||
float |
|
||
float |
|
||
float |
|
||
float |
|
||
list |
|
||
float |
|
||
3-float list |
|
Variables | |
readonly dictionary |
NoiseTypes =
The available noise types. |
readonly dictionary |
DistanceMetrics =
The available distance metrics values for Voronoi. |
Function Details |
|
|
|
|
|
|
Returns general turbulence vector using the optional specified noise basis function. @type xyz: 3-float tuple @param xyz: (x,y,z) float values. @type octaves: int @param octaves: number of noise values added. @type hard: bool @param hard: noise hardness: 0 - soft noise; 1 - hard noise. (Returned vector is always positive.) @type basis: int @param basis: type of noise used for turbulence, see L{NoiseTypes}. @type ampscale: float @param ampscale: amplitude scale value of the noise frequencies added. @type freqscale: float @param freqscale: frequency scale factor. @rtype: 3-float list @return: the generated turbulence vector. |
|
|
|
|
|
|
|
|
|
Variables Details |
NoiseTypesThe available noise types.
|
DistanceMetricsThe available distance metrics values for Voronoi.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Mon May 19 15:32:20 2008 | http://epydoc.sourceforge.net |