| Package | alternativa.engine3d.loaders |
| Class | public class LoaderOBJ |
| Inheritance | LoaderOBJ Loader3D flash.events.EventDispatcher |
Object3D.
Following OBJ commands are supported:
| Command | Description | Action |
|---|---|---|
| o object_name | Definition of a new object with name object_name | If there were defined faces for current object, command creates new object with given name, otherwise current object just changes name to given one. |
| v x y z | Definition of vertex with x y z coordinates | Vertex is put in general list of scene vertices for further usage |
| vt u [v] | Defining texture vertex with u v coordinates | Vertex is put to general texture vertices list for further usage |
| f v0[/vt0] v1[/vt1] ... vN[/vtN] | Defining face, which consist of given vertices and optional texture coordinates for vertices. | Face is added to a current active object. If there is an active material, face is added to surface of a current object, corresponding to a current material. |
| usemtl material_name | Set current material with name material_name | From the moment of setting current material, all the faces being created are put into current surface, corresponding to this material and having identifier equal to it's name. |
| mtllib file1 file2 ... | Defining files containing material definitions | Files are being loaded and material library is being formed. For texture materials lightmaps can be specified. If size of diffuse texture and size of lightmap of a material are different, then the lightmap is resized to match dimensions of the diffuse texture. |
See also
| Property | Defined by | ||
|---|---|---|---|
| blendMode : String = "normal" The value of the
blendMode property of texture materials which are created during loading process. | LoaderOBJ | ||
![]() | content : Object3D
The container with all loaded objects.
| Loader3D | |
| loadMaterials : Boolean = true If
false, then materials will not be loaded. | LoaderOBJ | ||
| mobility : int The value of the
mobility property of 3d objects. | LoaderOBJ | ||
| objectsAsGroups : Boolean If
true, then objects will be recognized by keyword "g" instead of "o". | LoaderOBJ | ||
| precision : Number = 10 The value of the
precision property of texture materials which are created during loading process. | LoaderOBJ | ||
| rotateModel : Boolean If
true, the loaded objects will be rotated around X axis by 90 degrees. | LoaderOBJ | ||
| scale : Number The scaling coefficient wich is applied to all loaded objects.
| LoaderOBJ | ||
| smooth : Boolean = false The value of the
smooth property of texture materials which are created during loading process. | LoaderOBJ | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new LoaderOBJ instance.
| LoaderOBJ | ||
![]() |
close():void
Stops current loading process.
| Loader3D | |
![]() |
load(url:String, loaderContext:LoaderContext = null):void
Loads a scene from specified URL.
| Loader3D | |
![]() |
loadBytes(data:ByteArray, baseUrl:String = null, loaderContext:LoaderContext = null):void
Loads data from a byte array.
| Loader3D | |
![]() |
unload():void
Clears internal references to the loaded data.
| Loader3D | |
| Method | Defined by | ||
|---|---|---|---|
|
clean():void
| LoaderOBJ | ||
|
closeInternal():void
| LoaderOBJ | ||
![]() |
complete():void
| Loader3D | |
![]() |
onMainLoadingError(e:ErrorEvent):void
| Loader3D | |
|
parse(data:ByteArray):void
| LoaderOBJ | ||
![]() |
setState(state:int):void
| Loader3D | |
|
unloadInternal():void
| LoaderOBJ | ||
| blendMode | property |
public var blendMode:String = "normal"The value of the blendMode property of texture materials which are created during loading process.
The default value is BlendMode.NORMAL.
See also
| loadMaterials | property |
public var loadMaterials:Boolean = trueIf false, then materials will not be loaded.
The default value is true.
| mobility | property |
mobility:int [read-write]The value of the mobility property of 3d objects.
The default value is 0.
public function get mobility():int
public function set mobility(value:int):void
See also
| objectsAsGroups | property |
objectsAsGroups:Boolean [read-write]If true, then objects will be recognized by keyword "g" instead of "o".
The default value is false.
public function get objectsAsGroups():Boolean
public function set objectsAsGroups(value:Boolean):void
| precision | property |
public var precision:Number = 10The value of the precision property of texture materials which are created during loading process.
The default value is TextureMaterialPrecision.MEDIUM.
See also
| rotateModel | property |
rotateModel:Boolean [read-write]If true, the loaded objects will be rotated around X axis by 90 degrees.
The default value is false.
public function get rotateModel():Boolean
public function set rotateModel(value:Boolean):void
| scale | property |
scale:Number [read-write]The scaling coefficient wich is applied to all loaded objects.
The default value is 1.
public function get scale():Number
public function set scale(value:Number):void
| smooth | property |
public var smooth:Boolean = falseThe value of the smooth property of texture materials which are created during loading process.
The default value is false.
See also
| LoaderOBJ | () | constructor |
public function LoaderOBJ()Creates a new LoaderOBJ instance.
| clean | () | method |
protected override function clean():void| closeInternal | () | method |
protected override function closeInternal():void| parse | () | method |
protected override function parse(data:ByteArray):voidParameters
data:ByteArray — |
| unloadInternal | () | method |
protected override function unloadInternal():void