Click or drag to resize
Ab4d.SharpEngine logo

ObjFileToSceneNodesConverter Class

ObjFileToSceneNodesConverter class can be used to convert the ObjFileData (3d model read from obj file) into SceneNode.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.ObjFileObjFileToSceneNodesConverter

Namespace: Ab4d.SharpEngine.ObjFile
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class ObjFileToSceneNodesConverter

The ObjFileToSceneNodesConverter type exposes the following members.

Constructors
 NameDescription
Public methodObjFileToSceneNodesConverter Initializes a new instance of the ObjFileToSceneNodesConverter class.
Top
Properties
 NameDescription
Public propertyDefaultBackMaterial Gets or sets a material that is used for BackMaterial when no other back material is specified in obj file. When set to null, no BackMaterial will be used.
Public propertyDefaultMaterial Gets or sets a material that is used when no other material is specified in obj file. By default DefaultMaterial is set to StandardMaterials.Silver.
Public propertyInvertYTextureCoordinate Gets or sets a boolean that specifies if Y texture coordinate is inverted.
Public propertyNamedObjects Gets a Dictionary with object name as key and MeshModelNode as value that defines names for the objects.
Public propertyResolveResourceFunc Gets or sets a Func that returns stream from the specified resource name. This can be used to read resources from stream. The returned stream will be closed by the ReaderObj.
Public propertyReuseMaterials Gets or sets a boolean that specified if one material instance defined in obj file can be reused for all SceneNode objects that use that material. If false than a new material instance will be created for each usage. Default value is true.
Public propertyTexturesDirectory Gets or sets a folder name that when set is used to read texture file names from.
Top
Methods
 NameDescription
Protected methodCheckTextureFileName CheckTextureFileName checks the texture file name and if file does not exist or is not in supported file format tries to find another file that can be used instead. Returns the file name that can be used to create a texture. If no file can be found, null is returned. The method can be overridden.
Public methodConvert(ObjFileData) Converts the ObjFileData into a GroupNode.
Public methodConvert(ObjMaterial) Converts ObjMaterial into a StandardMaterial.
Public methodConvert(ObjMesh, ObjFileData) Converts one ObjMeshData from ObjFileData into a SceneNode (MeshModelNode or GroupNode when more objects are converted)
Protected methodCreateTexture CreateGpuTexture method creates a GpuTexture from texture file name and sets that to the specified standardMaterial.
Top
See Also