Afraid i got stuck again -_-
I managed to load an obj file into the Cube demo and put a texture on it.
The TextureCoordinates however are ignored. (See pic) I checked the OBJ in Blender and in the Demo Tool from Assimp, both show it correctly so I guess Im loading it wrong.
I managed to load an obj file into the Cube demo and put a texture on it.
Code:
LMeshBuffer := MeshBufferInit; FModelTags := MeshMetaTagsInit; if LMeshBuffer.Initialized then try if not LMeshBuffer.LoadMeshFromFile(FModelTags, Utf8String('skull.obj'), FModelMinBounds, FModelMaxBounds, LDebugString) then begin MessageDlg(Format('Could not load mesh file: %s', [string(LDebugString)]), mtError, [mbOK], 0); Exit; end; FModelCube := LMeshBuffer.Model(FDevice, VertexElements); if not FModelCube.Initialized then begin MessageDlg('Could not create 3D cube model.', mtError, [mbOK], 0); Application.Terminate; Exit; end; finally LMeshBuffer.Free; end;
Comment