Package | away3d.extrusions |
Class | public class ElevationReader |
Property | Defined by | ||
---|---|---|---|
maxElevation : Number | ElevationReader | ||
minElevation : Number | ElevationReader | ||
source : BitmapData [read-only]
returns the generated bitmapdata, a smooth representation of the geometry.
| ElevationReader |
Method | Defined by | ||
---|---|---|---|
ElevationReader
(smoothness:int = 0)
Class generates a traced representation of the elevation geometry, allowing surface tracking to place or move objects on the elevation geometry.
| ElevationReader | ||
applyHeightGradient(src:BitmapData, color:uint = 0x80000000, reverse:Boolean = true, blendmode:String = "normal"):void
Apply the generated height source to a bitmapdata.
| ElevationReader | ||
getLevel(x:Number, y:Number, offset:Number = 0):Number
returns the generated bitmapdata, a smooth representation of the geometry.
| ElevationReader | ||
setSource(sourceBmd:BitmapData, channel:String = "r", factorX:Number = 1, factorY:Number = 1, factorZ:Number = .5):void
Optional method to be allow the use of a custom (externally) prerendered map.
| ElevationReader | ||
traceLevels(sourceBmd:BitmapData, channel:String = "r", subdivisionX:int = 10, subdivisionY:int = 10, factorX:Number = 1, factorY:Number = 1, elevate:Number = .5):void
generates the smooth representation of the geometry.
| ElevationReader |
maxElevation | property |
maxElevation:Number
[read-write]Implementation
public function get maxElevation():Number
public function set maxElevation(value:Number):void
minElevation | property |
minElevation:Number
[read-write]Implementation
public function get minElevation():Number
public function set minElevation(value:Number):void
source | property |
source:BitmapData
[read-only]returns the generated bitmapdata, a smooth representation of the geometry.
Implementation public function get source():BitmapData
ElevationReader | () | constructor |
public function ElevationReader(smoothness:int = 0)
Parameters
smoothness:int (default = 0 )
|
applyHeightGradient | () | method |
public function applyHeightGradient(src:BitmapData, color:uint = 0x80000000, reverse:Boolean = true, blendmode:String = "normal"):void
Apply the generated height source to a bitmapdata. The height information is merged to the source creating a smoother look.
Parameterssrc:BitmapData — The bitmapdata that will be merged.
|
|
color:uint (default = 0x80000000 ) — [optional] The color that will be applied. Note that 32 bits color will allow alpha. 0x88FF0000 defines a red with .5 alpha while 0xFF0000 defines a red with no alpha. Default is .5 alpha black.
|
|
reverse:Boolean (default = true ) — [optional] Defines if the color is set using the heightmap from 0-255 or 255-0. Default = true, if a black is used, the darkest are will be at the base of the elevation.
|
|
blendmode:String (default = "normal ") — [optional] Blendmode to be applyed in the merge. Possible string values are: lighten, multiply, overlay, screen, substract, add, darken, difference, erase, hardlight, invert and layer.Default = "normal";
|
getLevel | () | method |
public function getLevel(x:Number, y:Number, offset:Number = 0):Number
returns the generated bitmapdata, a smooth representation of the geometry.
Parametersx:Number — The x coordinate on the generated bitmapdata.
|
|
y:Number — The y coordinate on the generated bitmapdata.
|
|
offset:Number (default = 0 ) — [optional] the offset that will be added to the elevation value at the x and y coordinates plus the offset. Default = 0.
|
Number — A Number, the elevation value at the x and y coordinates plus the offset.
|
setSource | () | method |
public function setSource(sourceBmd:BitmapData, channel:String = "r", factorX:Number = 1, factorY:Number = 1, factorZ:Number = .5):void
Optional method to be allow the use of a custom (externally) prerendered map.
ParameterssourceBmd:BitmapData — Bitmapdata. The bitmapData to read from.
|
|
channel:String (default = "r ") — [optional] String. The channel information to read. Supported "a", alpha, "r", red, "g", green, "b", blue and "av" (averages and luminance). Default is red channel "r".
|
|
factorX:Number (default = 1 ) — [optional] Number. The scale multiplier along the x axis. Default is 1.
|
|
factorY:Number (default = 1 ) — [optional] Number. The scale multiplier along the y axis. Default is 1.
|
|
factorZ:Number (default = .5 ) — [optional] Number. The scale multiplier along the z axis (the elevation factor). Default is .5.
|
traceLevels | () | method |
public function traceLevels(sourceBmd:BitmapData, channel:String = "r", subdivisionX:int = 10, subdivisionY:int = 10, factorX:Number = 1, factorY:Number = 1, elevate:Number = .5):void
generates the smooth representation of the geometry. uses same parameters as the Elevation class.
ParameterssourceBmd:BitmapData — Bitmapdata. The bitmapData to read from.
|
|
channel:String (default = "r ") — [optional] String. The channel information to read. supported "a", alpha, "r", red, "g", green, "b", blue and "av" (averages and luminance). Default is red channel "r".
|
|
subdivisionX:int (default = 10 ) — [optional] int. The subdivision to read the pixels along the x axis. Default is 10.
|
|
subdivisionY:int (default = 10 ) — [optional] int. The subdivision to read the pixels along the y axis. Default is 10.
|
|
factorX:Number (default = 1 ) — [optional] Number. The scale multiplier along the x axis. Default is 1.
|
|
factorY:Number (default = 1 ) — [optional] Number. The scale multiplier along the y axis. Default is 1.
|
|
elevate:Number (default = .5 ) — [optional] Number. The scale multiplier along the z axis. Default is .5.
|
See also