Packageaway3d.materials.utils
Classpublic class NormalMapGenerator
InheritanceNormalMapGenerator Inheritance flash.events.EventDispatcher

Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
Events
 EventSummaryDefined by
   Dispatched while the class is busy tracing.NormalMapGenerator
   Dispatched full trace is done.NormalMapGenerator
Property detail
bumpmapproperty
bumpmap:BitmapData  [read-only]

Returns the generated bump source for a displacementfilter generated by the class

Implementation
    public function get bumpmap():BitmapData
normalmapproperty 
normalmap:BitmapData  [read-only]

Returns the normalMap generated by the class

Implementation
    public function get normalmap():BitmapData
Constructor detail
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.
Init Parameters
Method detail
addOnTraceComplete()method
public function addOnTraceComplete(listener:Function):void

Default method for adding a tracecomplete event listener

Parameters
listener:Function — The listener function
addOnTraceProgress()method 
public function addOnTraceProgress(listener:Function):void

Default method for adding a traceprogress event listener

Parameters
listener: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.

Parameters
bm:BitmapData — BitmapData. The source bumpmap.
 
nm:BitmapData — BitmapData. The source normalmap. return BitmapData. The source normalmap with the bump applied to it

Returns
BitmapData
removeOnTraceComplete()method 
public function removeOnTraceComplete(listener:Function):void

Default method for removing a tracecomplete event listener

Parameters
listener:Function — The listener function
removeOnTraceProgress()method 
public function removeOnTraceProgress(listener:Function):void

Default method for removing a traceprogress event listener

Parameters
listener:Function — The listener function
Event detail
tracecompleteevent 
Event object type: away3d.events.TraceEvent

Dispatched while the class is busy tracing. Note that the source can already be used for a Material

traceprogressevent  
Event object type: away3d.events.TraceEvent

Dispatched full trace is done.

Wiki link
Click to go to the wiki page for 'away3d.materials.utils.NormalMapGenerator'

Code examples

Comments