Click or drag to resize
Ab4d.SharpEngine logo

ReaderObjReadSceneNodes(Stream, FuncString, Stream, Material) Method

Reads the 3D models from stream and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes. When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set a method that converts the resource name into Stream. The method will not return null but an empty GroupNode in case no model is read.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public GroupNode ReadSceneNodes(
	Stream objStream,
	Func<string, Stream?> resolveResourceFunc,
	Material? defaultMaterial
)

Parameters

objStream  Stream
stream with obj file
resolveResourceFunc  FuncString, Stream
method that converts the resource name into Stream - used to read additional resources (materials and textures)
defaultMaterial  Material
material that is used if no material is defined in obj file

Return Value

GroupNode
GroupNode that contains MeshModelNodes and other GroupNodes
See Also