Packageaway3d.loaders
Classpublic class Obj

File loader for the OBJ file format.

note: Multiple objects support and autoload mtls are supported since Away v 2.1.
Class tested with the following 3D apps:
- Strata CX mac 5.5
- Biturn ver 0.87b4 PC
- LightWave 3D OBJ Export v2.1 PC
- Max2Obj Version 4.0 PC
- AC3D 6.2.025 mac
- geometry supported tags: f,v,vt, g are being used
- geometry unsupported tags:vn,ka, kd r g b, kd, ks r g b,ks,ke r g b,ke,d alpha,d,tr alpha,tr,ns s,ns,illum n,illum,map_Ka,map_Bump
- mtl unsupported tags: kd,ka,ks,ns,tr

export from apps as polygon group or mesh as .obj file.

Public Properties
 PropertyDefined by
  mesh : Mesh
Obj
Public Methods
 MethodDefined by
  
Obj
(data:String, urlbase:String = "", init:Object = null)
Creates a new Obj object.
Obj
  
load(url:String, init:Object = null):Object3DLoader
[static] Loads and parses a obj file into a 3d mesh object.
Obj
  
parse(data:*, init:Object = null, loader:Object3DLoader = null):Object3D
[static] Creates a 3d mesh object from the raw ascii data of a obj file.
Obj
Property detail
meshproperty
public var mesh:Mesh
Constructor detail
Obj()constructor
public function Obj(data:String, urlbase:String = "", init:Object = null)Parameters
data:String — The binary data of a loaded file.
 
urlbase:String (default = "") — The url of the .obj file, required to compose the url mtl adres and be able access the bitmap sources relative to mtl location.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
####INIT####

See also

Method detail
load()method
public static function load(url:String, init:Object = null):Object3DLoader

Loads and parses a obj file into a 3d mesh object.

Parameters
url:String — The url location of the file to load.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.

Returns
Object3DLoader — A 3d loader object that can be used as a placeholder in a scene while the file is loading.
parse()method 
public static function parse(data:*, init:Object = null, loader:Object3DLoader = null):Object3D

Creates a 3d mesh object from the raw ascii data of a obj file.

Parameters
data:* — The ascii data of a loaded file.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
 
loader:Object3DLoader (default = null) — [optional] Not intended for direct use.

Returns
Object3D — A 3d mesh object representation of the obj file.
Wiki link
Click to go to the wiki page for ####WIKI####

Code examples

Comments