Package | away3d.materials.utils |
Class | public class NormalMapGenerator |
Inheritance | NormalMapGenerator ![]() |
Property | Defined by | ||
---|---|---|---|
bumpmap : BitmapData [read-only]
Returns the generated bump source for a displacementfilter generated by the class
| NormalMapGenerator | ||
normalmap : BitmapData [read-only]
Returns the normalMap generated by the class
| NormalMapGenerator |
Method | Defined by | ||
---|---|---|---|
NormalMapGenerator
(mesh:Mesh, width:int = 512, height:int = 512, bumpsource:BitmapData = null, blur:int = 0, maxfaces:int = 50)
Class NormalMapGenerator generates a normalmap from a given Mesh object and merge an additionl bump information to it.
| NormalMapGenerator | ||
addOnTraceComplete(listener:Function):void
Default method for adding a tracecomplete event listener
| NormalMapGenerator | ||
addOnTraceProgress(listener:Function):void
Default method for adding a traceprogress event listener
| NormalMapGenerator | ||
applyBump(bm:BitmapData, nm:BitmapData):BitmapData
Applys a bump to a given normal map.
| NormalMapGenerator | ||
removeOnTraceComplete(listener:Function):void
Default method for removing a tracecomplete event listener
| NormalMapGenerator | ||
removeOnTraceProgress(listener:Function):void
Default method for removing a traceprogress event listener
| NormalMapGenerator |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched while the class is busy tracing. | NormalMapGenerator | |||
Dispatched full trace is done. | NormalMapGenerator |
bumpmap | property |
bumpmap:BitmapData
[read-only]Returns the generated bump source for a displacementfilter generated by the class
Implementation public function get bumpmap():BitmapData
normalmap | property |
normalmap:BitmapData
[read-only]Returns the normalMap generated by the class
Implementation public function get normalmap():BitmapData
NormalMapGenerator | () | constructor |
public function NormalMapGenerator(mesh:Mesh, width:int = 512, height:int = 512, bumpsource:BitmapData = null, blur:int = 0, maxfaces:int = 50)
Parameters
mesh:Mesh — Object3D. The mesh Object3D to be updated.
|
|
width:int (default = 512 ) — [optional] int. The width of the generated normalmap. Default is 512.
|
|
height:int (default = 512 ) — [optional] int. The height of the generated normalmap. Default is 512.
|
|
bumpsource:BitmapData (default = null ) — [optional] BitmapData. The source bitmapdata for an additional bump information. Default is null;
|
|
blur:int (default = 0 ) — [optional] int. Blur value if applyed, the surface of the object becomes smoother. Default is 0;
|
|
maxfaces:int (default = 50 ) — [optional] int. To avoid that the player generates a timout error, the class handles the trace of faces stepwize. Default is 50 faces.
|
addOnTraceComplete | () | method |
public function addOnTraceComplete(listener:Function):void
Default method for adding a tracecomplete event listener
Parameterslistener:Function — The listener function
|
addOnTraceProgress | () | method |
public function addOnTraceProgress(listener:Function):void
Default method for adding a traceprogress event listener
Parameterslistener:Function — The listener function
|
applyBump | () | method |
public function applyBump(bm:BitmapData, nm:BitmapData):BitmapData
Applys a bump to a given normal map. If you do not generate the map from a mesh, just pass null in the constructor.
Parametersbm:BitmapData — BitmapData. The source bumpmap.
|
|
nm:BitmapData — BitmapData. The source normalmap.
return BitmapData. The source normalmap with the bump applied to it
|
BitmapData |
removeOnTraceComplete | () | method |
public function removeOnTraceComplete(listener:Function):void
Default method for removing a tracecomplete event listener
Parameterslistener:Function — The listener function
|
removeOnTraceProgress | () | method |
public function removeOnTraceProgress(listener:Function):void
Default method for removing a traceprogress event listener
Parameterslistener:Function — The listener function
|
tracecomplete | event |
away3d.events.TraceEvent
Dispatched while the class is busy tracing. Note that the source can already be used for a Material
traceprogress | event |