Loading 3D models
DirectGPU can load OBJ models and render them inside a 3D scene.
Loading a model
Section titled “Loading a model”OBJ data can be loaded from a string:
local modelId = gpu.load3DModel(objData)For Base64 encoded OBJ data:
local modelId = gpu.load3DModelFromBytes(base64ObjData)Rendering the model
Section titled “Rendering the model”Once loaded, use draw3DModel:
gpu.draw3DModel( displayId, modelId, 0, 0, 0, 0, 45, 0, 1, 255, 255, 255)Using textures
Section titled “Using textures”If you have a loaded texture:
gpu.draw3DModelTextured( displayId, modelId, 0, 0, 0, 0, 0, 0, 1, textureId)Removing models
Section titled “Removing models”When finished:
gpu.unload3DModel(modelId)