TDSLoader Class

Module: ExternalLoader

Autodesk 3DS threee.js file loader, based on lib3ds.

Loads geometry with uv and materials basic properties with texture support.

Constructor

TDSLoader

(
  • manager
)

Parameters:

  • manager LoadingManager

    Loading manager.

Methods

debugMessage

(
  • message
)

Print debug message to the console.

Is controlled by a flag to show or hide debug messages.

Parameters:

  • message Object

    Debug message to print to the console.

endChunk

(
  • chunk
)

Set position to the end of the current chunk of data.

Parameters:

  • chunk Object

    Data chunk.

load

(
  • url
  • onLoad
  • onProgress
  • onError
)

Load 3ds file from url.

Parameters:

  • url type

    URL for the file.

  • onLoad Function

    onLoad callback, receives group Object3D as argument.

  • onProgress Function

    onProgress callback.

  • onError Function

    onError callback.

nextChunk

(
  • data
  • chunk
)

Move to the next data chunk.

Parameters:

  • data DataView

    Dataview.

  • chunk Object

    Data chunk.

parse

(
  • arraybuffer
  • path
)
Object3D

Parse arraybuffer data and load 3ds file.

Parameters:

  • arraybuffer ArrayBuffer

    Arraybuffer data to be loaded.

  • path String

    Path for external resources.

Returns:

Object3D:

Group loaded from 3ds file.

readByte

(
  • data
)
Number

Read byte value.

Parameters:

  • data DataView

    Dataview to read data from.

Returns:

Number:

Data read from the dataview.

readChunk

(
  • data
)
Object

Read next chunk of data.

Parameters:

  • data DataView

    Dataview.

Returns:

Object:

Chunk of data read.

readColor

(
  • data
)
Color

Read a color value.

Parameters:

  • data DataView

    Dataview.

Returns:

Color:

Color value read..

readDWord

(
  • data
)
Number

Read 64 bit unsigned integer value.

Parameters:

  • data DataView

    Dataview to read data from.

Returns:

Number:

Data read from the dataview.

readFaceArray

(
  • data
  • mesh
)

Read face array data chunk.

Parameters:

  • data Dataview

    Dataview in use.

  • mesh Mesh

    Mesh to be filled with the data read.

readFile

(
  • arraybuffer
)

Decode file content to read 3ds data.

Parameters:

  • arraybuffer ArrayBuffer

    Arraybuffer data to be loaded.

readFloat

(
  • data
)
Number

Read 32 bit float value.

Parameters:

  • data DataView

    Dataview to read data from.

Returns:

Number:

Data read from the dataview.

readInt

(
  • data
)
Number

Read 32 bit signed integer value.

Parameters:

  • data DataView

    Dataview to read data from.

Returns:

Number:

Data read from the dataview.

readMap

(
  • data
)
Texture

Read texture map data chunk.

Parameters:

  • data Dataview

    Dataview in use.

Returns:

Texture:

Texture read from this data chunk.

readMaterialEntry

(
  • data
)

Read material data chunk and add it to the material list.

Parameters:

  • data Dataview

    Dataview in use.

readMaterialGroup

(
  • data
)
Object

Read material group data chunk.

Parameters:

  • data Dataview

    Dataview in use.

Returns:

Object:

Object with name and index of the object.

readMesh

(
  • data
)

Read mesh data chunk.

Parameters:

  • data Dataview

    Dataview in use.

readMeshData

(
  • data
)

Read mesh data chunk.

Parameters:

  • data Dataview

    Dataview in use.

readNamedObject

(
  • data
)

Read named object chunk.

Parameters:

  • data Dataview

    Dataview in use.

readShort

(
  • data
)
Number

Read 16 bit signed integer value.

Parameters:

  • data DataView

    Dataview to read data from.

Returns:

Number:

Data read from the dataview.

readString

(
  • data
  • maxLength
)
String

Read string value.

Parameters:

  • data DataView

    Dataview to read data from.

  • maxLength Number

    Max size of the string to be read.

Returns:

String:

Data read from the dataview.

readWord

(
  • data
)
Number

Read 32 bit unsigned integer value.

Parameters:

  • data DataView

    Dataview to read data from.

Returns:

Number:

Data read from the dataview.

resetPosition

(
  • data
)

Reset dataview position.

Parameters:

  • data DataView

    Dataview.

setPath

(
  • path
)

Set resource path used to determine the file path to attached resources.

Parameters:

  • path String

    Path to resources.

Returns:

Self for chaining.