It is currently Sat Dec 05, 2020 9:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to place a 3d mesh onto display
PostPosted: Mon Oct 14, 2019 10:28 am 
Offline
User
User

Joined: Sat Apr 13, 2019 12:17 pm
Posts: 48
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:
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()


Top
 Profile  
Reply with quote  
 Post subject: Re: How to place a 3d mesh onto display
PostPosted: Mon Oct 14, 2019 4:17 pm 
Offline
User
User

Joined: Mon Sep 03, 2012 8:52 pm
Posts: 84
Pure Basic Ogre3D only supports the ogre3d .mesh format. The Mesh.pb example in the 3D folder of Pure Basic would explain it better.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to place a 3d mesh onto display
PostPosted: Mon Oct 14, 2019 7:48 pm 
Offline
Addict
Addict

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 1404
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 53 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye