Unit Object3dAsVRML

DescriptionusesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Converting 3D models to VRML. Converts models in various formats to one or more (static or animation) VRML nodes.

Note: for VRML 1.0, remember that you may want to embed returned TVRMLNode objects inside VRML Separator node before inserting it into some existing VRML scene.

uses

Overview

Functions and Procedures

function LoadGEOAsVRML(const filename: string): TVRMLNode;
function LoadOBJAsVRML(const filename: string): TVRMLNode;
function Load3dsAsVRML(const filename: string): TVRMLNode;
function LoadMD3AsVRML(const FileName: string): TVRMLNode;
function LoadMD3FrameAsVRML(Md3: TObject3dMD3; FrameNumber: Cardinal; const WWWBasePath: string): TVRMLNode;
procedure LoadMD3AsVRMLSequence( const FileName: string; RootNodes: TVRMLNodesList; Times: TDynSingleArray; out ScenesPerTime: Cardinal; var Optimization: TGLRendererOptimization; out EqualityEpsilon: Single; out TimeLoop, TimeBackwards: boolean);
function LoadAsVRML(const filename: string; AllowStdIn: boolean = false): TVRMLNode;
procedure LoadAsVRMLSequence( const FileName: string; AllowStdIn: boolean; RootNodes: TVRMLNodesList; Times: TDynSingleArray; out ScenesPerTime: Cardinal; var Optimization: TGLRendererOptimization; out EqualityEpsilon: Single; out TimeLoop, TimeBackwards: boolean);

Description

Functions and Procedures

function LoadGEOAsVRML(const filename: string): TVRMLNode;
 
function LoadOBJAsVRML(const filename: string): TVRMLNode;
 
function Load3dsAsVRML(const filename: string): TVRMLNode;
 
function LoadMD3AsVRML(const FileName: string): TVRMLNode;
 
function LoadMD3FrameAsVRML(Md3: TObject3dMD3; FrameNumber: Cardinal; const WWWBasePath: string): TVRMLNode;

Load a specific animation frame from a given Md3 model.

Parameters
Md3
is the MD3 file to use.
FrameNumber
is the frame number to load, must be < Md3.Count.
WWBasePath
is WWBasePath value to set in resulting VRML nodes.
procedure LoadMD3AsVRMLSequence( const FileName: string; RootNodes: TVRMLNodesList; Times: TDynSingleArray; out ScenesPerTime: Cardinal; var Optimization: TGLRendererOptimization; out EqualityEpsilon: Single; out TimeLoop, TimeBackwards: boolean);

This is much like LoadAsVRMLSequence, but it only handles MD3 files. Usually you want to use LoadAsVRMLSequence, not this procedure.

function LoadAsVRML(const filename: string; AllowStdIn: boolean = false): TVRMLNode;

This guesses model format basing on ExtractFileExt(filename), then loads model converting it to VRML with appropriate LoadXxxAsVRML functions above in this unit or using ParseVRMLFile if this seems to be a VRML file.

If AllowStdIn and FileName = '-' then it will load a VRML file from StdInStream (using GetCurrentDir as WWWBasePath).

procedure LoadAsVRMLSequence( const FileName: string; AllowStdIn: boolean; RootNodes: TVRMLNodesList; Times: TDynSingleArray; out ScenesPerTime: Cardinal; var Optimization: TGLRendererOptimization; out EqualityEpsilon: Single; out TimeLoop, TimeBackwards: boolean);

Load various model formats as animation expressed by VRML sequence.

For model formats that cannot express animations (like GEO or Wavefront OBJ) or that express animations in a single VRML file (like VRML > 2.0) this just loads them like LoadAsVRML, adding exactly one item to RootNodes. This guarantees that this function handles at least the same model formats as LoadAsVRML — but actually it may handle more.

And indeed, it currently handles kanim, that is completely unrecognized by LoadAsVRML.

This handles animations in kanim and MD3 formats.

Parameters
RootNodes
Sequence of root nodes will be stored there. Pass here some created and empty instance of TVRMLNodesList.
ATimes
Sequence of time values. Pass here some created and empty instance of TDynSingleArray.
AOptimization
This is a var variable: it will be set only if a file format will actually specify it (for now, this is only for kanim format). For other formats, it will not be modified. So you should set this to "preferred Optimization value for other formats than kanim".

Generated by PasDoc 0.10.0 on 2008-02-25 00:00:37