How to place a 3d mesh onto display

Just starting out? Need help? Post your questions and find answers here.
pfaber11
User
User
Posts: 48
Joined: Sat Apr 13, 2019 12:17 pm

How to place a 3d mesh onto display

Post by pfaber11 »

Hi I've opened a 3d window and got a .obj mesh . How can I put it onto the screen .I have a camera .

Code: Select all

InitEngine3D() This is where I'm at.
InitKeyboard()
InitSprite()
InitMouse()

OpenWindow(0, 0, 0, 1366, 768, "window")
OpenWindowedScreen(WindowID(0), 250, 250, 500, 500)

CompilerIf #PB_Compiler_OS = #PB_OS_Windows
  Add3DArchive(#PB_Compiler_Home + "C:/users/pfabe/documents", #PB_3DArchive_FileSystem)
;CompilerElseIf #PB_Compiler_OS = #PB_OS_Linux
 ; Add3DArchive(#PB_Compiler_Home + "c:/users/pfabe/documents", #PB_3DArchive_FileSystem)
CompilerEndIf



LoadMesh(1,"paul.obj")
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 100, 100)
RenderWorld()
FlipBuffers()
box_80
User
User
Posts: 95
Joined: Mon Sep 03, 2012 8:52 pm

Re: How to place a 3d mesh onto display

Post by box_80 »

Pure Basic Ogre3D only supports the ogre3d .mesh format. The Mesh.pb example in the 3D folder of Pure Basic would explain it better.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: How to place a 3d mesh onto display

Post by applePi »

natively PB can load only *.mesh files. look the examples.
but if you want to load specificaly wavefront *.obj models then we need first to extract the the coordinates, ..., and display it either by the usual OpenGl or by the native PB ogre 3d graphics. and this is complex when we consider also the normals values and texture coordinates, look a primary code to load .obj files:
viewtopic.php?f=36&t=68420
while you are viewing some file, right click to show the mouse cursor and load another file
for unknown reasons the file LoadObjMesh_Tri.pb display woman.obj in PB 5.46 better than v5.71
Image
v5.46
Image
v5.71
Post Reply