Page 1 of 1

OGRE tools

Posted: Tue Jan 22, 2013 4:08 pm
by Fred
Here is a quick list of useful tools when starting with 3D and PureBasic. The used engine is OGRE, so any tools related to it should work with PureBasic.

- OgreASSIMPConverter: commandline tool for Ogre 1.8, it will accept in input all formats supported by assimp (see here: ... rmats.html) and output a .mesh with .material and .sekeleton. ... (Windows only, requiers the VC++2010 runtime)

- Ogre Meshy: advanced mesh viewer, with bone and animation display -

Don't hesitate to tell us which tools is interesting to work with PureBasic !

Re: OGRE tools

Posted: Tue Jan 22, 2013 4:51 pm
by djes

Re: OGRE tools

Posted: Tue Jan 22, 2013 11:36 pm
by Comtois
Deled (free): Editor 3D ->

and if you're interested there is a competition "DeleD Winter Compo 2012!" valid until January 31, see details at this address ... sc&start=0
The Rewards
- 50 euros (or 66 US dollars) for the winner, payable via Paypal. But if more than 15 contenders play along, price money goes up to 100 euros! Very Happy
- A Single Developer license of Smart Packer Pro kindly offered by Smart Packer Solutions.
- Having a fun time and sharing that with your fellow DeleD users. Smile
- Eternal fame and glory!

Re: OGRE tools

Posted: Thu Jan 24, 2013 4:39 am
by J. Baker
Also, if you enjoy good old CharacterFX like me. Then grab your copy of CharacterFiX (made in PureBasic) to convert your files to the OGRE formats. Both tools are free!

Currently supports single texture models and animation. ;)

Re: OGRE tools

Posted: Fri Feb 01, 2013 7:42 pm
by applePi
OgreMax Viewers
i have tried OgreMaxWinViewer, it loades the meshes saved from points list without errors while OgreMeshy fails , such meshes described here: ... 36&t=53159

Re: OGRE tools

Posted: Tue Dec 24, 2013 7:25 am
by Samuel
I recently stumbled across Yaose (Yet Another Ogre Script Editor). It's a nice free editor for OGRE's script syntax.
The 3.0 version is also open source so if need be you can do some editing to it. wrote: Yaose is a pro­gram for edit­ing Ogre script files. Yaose doesn't only have syn­tax highlighting, but also in­tel­lisense and code com­ple­tion, which makes writ­ing e.g. ma­te­rial scripts a lot easier.

I wrote Yaose, be­cause some­thing like this didn't ex­ist be­fore—at least­—not a good one.
Other ed­i­tors didn't work prop­erly or weren't fin­ished, and all they could do was edit­ing ma­te­rial scripts.
Note­pad wasn't re­ally do­ing the job ei­ther, so I wrote Yaose.

Yaose cur­rently sup­ports edit­ing of ma­te­rial scripts, over­lay scripts, par­ti­cle scripts, com­pos­i­tor scripts and font­def scripts.
Yaose makes work­ing with colours easier with a colour picker. It suggests pos­si­ble val­ues for pa­ram­e­ters while typ­ing, and it even re­mem­bers vari­ables.

Re: OGRE tools

Posted: Sat Sep 06, 2014 10:00 am
by Danilo
Fred wrote: (Windows only, requiers the VC++2010 runtime)
Any chance you provide OgreAssimpConverter for Linux and Mac OS X, too?

Assimp says: "Written in portable, ISO-compliant C++"
Why not include it into PB? It is required to work with PB/OGRE because
we need to convert all 3D object files to OGRE format.

Re: OGRE tools

Posted: Thu Apr 12, 2018 4:06 pm
by applePi
GLXtractor is a GUI tool which can be used to capture the Geometry from PureBasic Ogre 3D running programs and rendered with opengl subsystem . it captured the vertex positions, faces, normals, UV and direct these data to wavefront OBJ file , it captures also the texture used whether it is standalone image file or generated from code.
it can also capture geometry from PB opengl programs
download it from ... t/~alexan/
its latest version is , in the second link they say "Version 1.0 is not available yet"
How to use:
1- compile the following code (with opengl subsystem) to sphere.exe and save it to purebasic\compilers
2- run the GLXtractor program and accept the defaults. click on "Choose App" and choose the sphere.exe you have saved before.
3- click on Ogle Plugin Tab and choose capture texture ... capture. this is to capture the UV and normals data
4- click Start Application
5- when the purebasic program launched use either the mouse or ALT-TAB to focus on the GLXtractor window , and press ctrl-shift-f . you will notice the rendering stop for a second or more (may be 10 seconds for very big meshes.)
6- exit the purebasic program
7- look at My Documents - Xtracted folder (or whatever you choose before running PB example exe)
you will find sphere.obj and a texture . note it will work for meshes have submeshes such as "AKM.mesh" in the folder Models inside purebasic example data. but will not work with animated meshes such as robot.mesh ...

Code: Select all


Global CameraSpeed.f = 0.07
Define.f KeyX, KeyY
Quit.b = #False

OpenWindow(0, 0, 0, 800, 600, "simple scene ... ,  move the camera with arrow keys ... , Space: stop/start rotation ... W: wire/solid", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600)
Add3DArchive(".", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Models", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Scripts",#PB_3DArchive_FileSystem)

CreateMaterial(0, LoadTexture(0, "MRAMOR6X6.jpg"))
MaterialCullingMode(0, #PB_Material_NoCulling)

CreateSphere(0, 1, 32,32)
;LoadMesh(0, "AKM.mesh")

SetMeshMaterial(0, MaterialID(0))

CreateEntity(0, MeshID(0), #PB_Material_None, 0, 0, 0)

MeshRad.f = MeshRadius(0)
ScaleEntity(0, 1.244/MeshRad, 1.24/MeshRad, 1.24/MeshRad) 

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 2, 5, #PB_Absolute)
CameraLookAt(0, 0,0,0)
CreateLight(0, RGB(200,150,100), 10, 2000, 300)
AmbientColor(RGB(90, 90, 60))

rot = 1

      Select WindowEvent()
         Case #PB_Event_None
         Case #PB_Event_CloseWindow
            Break 2
  If ExamineKeyboard()
        If KeyboardPushed(#PB_Key_Left)
          KeyX = -CameraSpeed
        ElseIf KeyboardPushed(#PB_Key_Right)
          KeyX = CameraSpeed
          KeyX = 0
        If KeyboardPushed(#PB_Key_Up)
          KeyY = -CameraSpeed
        ElseIf KeyboardPushed(#PB_Key_Down)
          KeyY = CameraSpeed
          KeyY = 0
        If KeyboardReleased(#PB_Key_W)
          wire ! 1
          If wire
            MaterialShadingMode(0, #PB_Material_Wireframe)
            MaterialShadingMode(0, #PB_Material_Solid) 
        If KeyboardReleased(#PB_Key_Space)
          rot ! 1
  MoveCamera  (0, KeyX, 0, KeyY)
  RotateEntity(0, 0,rot/2,0, #PB_Relative)
Until KeyboardPushed(#PB_Key_Escape)
try GLXtractor with the following PB opengl code, try to capture its graphics

Code: Select all

Structure Point3D


Declare FillArray()
Global.f txu, txv

Define event, quit

#ImagePath = #PB_Compiler_Home + "examples/3d/Data/Textures/"

 LoadImage(1, #ImagePath+"axes.png")
 *Buffer = EncodeImage(1) ; default is: #PB_ImagePlugin_BMP : encode the image in BMP 
Define TexID

OpenWindow(0, 0, 0, DesktopWidth(0), DesktopHeight(0), "... Up/Down: zoom in/out... 'W': wire frame... 'A'/'Z': change Camera view")
SetWindowColor(0, RGB(200,220,200))
OpenGLGadget(0, 10, 10, WindowWidth(0) , WindowHeight(0) , #PB_OpenGL_Keyboard)

;- Generate texture
glGenTextures_(1, @TexID)
glBindTexture_(#GL_TEXTURE_2D, TexID)
glTexImage2D_(#GL_TEXTURE_2D, 0, 3, ImageWidth(1), ImageHeight(1), 0, #GL_BGR_EXT, #GL_UNSIGNED_BYTE, *Buffer+57)


glEnable_(#GL_TEXTURE_2D)   ; Enable texture mapping 
glBindTexture_(#GL_TEXTURE_2D, TexID)

gluPerspective_(45.0, DesktopWidth(0)/DesktopHeight(0), 1.0, 60.0)
glTranslatef_(0, 0, -5)

Global NbX = 100
Global NbZ = 100

Global Dim Point3D.Point3D(0)
Global Dim MeshDataInd.PB_MeshFace(0)
Global indexsize ;= ArraySize(MeshDataInd()) + 1
;Debug indexsize

  ;Debug VertexIndex  
rot.f = 1
;glPointSize_( 3 )  
;glTranslatef_(0.0, 0.0, -30)
SetActiveGadget(0) ; make the openGLgadget active

glPushMatrix_(); to store the current state
gluPerspective_(45.0, WindowWidth(0)/WindowHeight(0), 1.0, 800.0)
glTranslatef_(0, 0, -1)
glViewport_(0, 0, WindowWidth(0), WindowHeight(0))

gluLookAt_( 0, 1, 1, ; the camera looking from position 0,0.3,0.5  to 0,0,0 from above
            0,  0, 0,
            0,  1,  0 ) 

glPolygonMode_(#GL_FRONT_AND_BACK, #GL_LINE )
t=1: zz=30
;Debug indexsize
  Event = WindowEvent()
  glViewport_(0, 0, WindowWidth(0), WindowHeight(0))
  glClearColor_(0.9, 0.9, 0.9, 1)
  ;glClearColor_(0.3, 0.3, 0.3, 1)
  glEnableClientState_(#GL_VERTEX_ARRAY )
  glRotatef_(rot/5, 0, 1, 0);
  glVertexPointer_(3, #GL_FLOAT,SizeOf(Point3D),@Point3D(0)\x)
  glColorPointer_(3, #GL_FLOAT, SizeOf(Point3D), @Point3D(0)\r)
  glTexCoordPointer_(2, #GL_FLOAT, SizeOf(Point3D), @Point3D(0)\tu)
  ;glDrawElements_(#GL_LINES,indexsize,#GL_UNSIGNED_INT, @MeshDataInd(0)\Index)
  ;glDrawElements_(#GL_POINTS,indexsize,#GL_UNSIGNED_INT, @MeshDataInd(0)\Index)
  ;glDrawElements_(#GL_TRIANGLES,indexsize,#GL_UNSIGNED_INT, @MeshDataInd(0)\Index)
  glDrawElements_(#GL_QUADS,indexsize,#GL_UNSIGNED_INT, @MeshDataInd(0)\Index)
  If Event = #PB_Event_Gadget And EventGadget() = 0 
    If EventType() = #PB_EventType_KeyDown  ; like KeyboardReleased
            key = GetGadgetAttribute(0,#PB_OpenGL_Key )
            If key = #PB_Shortcut_Escape ;  Esc key to exit
               quit = 1
               ElseIf Key = #PB_Shortcut_W; display wire Frame or solid frame
               If fill
                glPolygonMode_(#GL_FRONT_AND_BACK, #GL_LINE)
                fill ! 1
                glPolygonMode_(#GL_FRONT_AND_BACK, #GL_FILL )
                fill ! 1
              ElseIf Key = #PB_Shortcut_Up
              ElseIf Key = #PB_Shortcut_Down
              ElseIf Key = #PB_Shortcut_A
                glLoadIdentity_()           ;
                gluLookAt_(0, 3, 1,  0,0,0,  0,1,0 ) 
              ElseIf Key = #PB_Shortcut_Z
                gluLookAt_(0, 1, 2,  0,0,0,  0,1,0 )  
   SetGadgetAttribute(0, #PB_OpenGL_FlipBuffers, #True)
Until Event = #PB_Event_CloseWindow Or quit = 1

glDeleteTextures_(1, @TexID)

Macro Vertex(u, v, txu, txv)
  ;this produce very beautiful shape
  x.f = 0.5 * (1 - Cos(u)) * Sin(u) * Cos(v)
  y.f = 0.5 * (1 - Cos(u)) * Sin(u) * Sin(v)
  z.f = Cos(u)
  ;this produce a sphere shape
  ;x.f = 0.5 * Cos(u)* Sin(v)
  ;y.f = 0.5 * Sin(u)* Sin(v)
  ;z.f = 0.5 * Cos(v)
  ReDim Point3D.Point3D(a)
  Point3D(a)\x = x*1
  Point3D(a)\y = y*1
  Point3D(a)\z = z*1
  Point3D(a)\tu = txu
  Point3D(a)\tv = txv
  Point3D(a)\r = 1.0 :Point3D(a)\g = 1.0 :Point3D(a)\b = 1

Procedure FillArray()
  Protected.f u, v, Delta = 4*#PI/NbX ; change 4 to 2 to get more quads
  Protected.f x, y, z
  txu.f : txv.f
  ;Debug delta  
  u = 0
  v = 0
  While v <= 2 * #PI
    While u <= 1 * #PI ; change 2 to 1 and will get half of the object
      Vertex(u, v, txu, txv)
      Vertex(u + Delta, v, txu+u/NbX*#PI, txv)
      Vertex(u + Delta, v + Delta, txu+u/NbX*#PI, txv+v/NbX*#PI)
      Vertex(u, v + Delta, txu, txv+v/NbX*#PI)
      txu = txu + u/NbX*#PI ; for texturing
      ReDim MeshDataInd.PB_MeshFace(VertexIndex+4)
      MeshDataInd(VertexIndex)\Index = VertexIndex   + 0
      MeshDataInd(VertexIndex+1)\Index = VertexIndex + 1
      MeshDataInd(VertexIndex+2)\Index = VertexIndex + 2
      MeshDataInd(VertexIndex+3)\Index = VertexIndex + 3

      VertexIndex + 4
      u + Delta
    txu = 0
    txv = txv + v/NbX*1*#PI ; for texturing
    u = 0
    v + Delta
  indexsize = ArraySize(MeshDataInd())
  ;Debug indexsize
  ;Debug VertexIndex
if our approach in constructing a manual mesh is like this:
CreateMesh(0, #PB_Mesh_TriangleList, #PB_Mesh_Static)
MeshVertexPosition(-1, 0, -1) ; vertex number 0
MeshVertexPosition(-1, 0, 1) ; vertex number 1
MeshVertexPosition( 1, 0, 1) ; vertex number 2
MeshVertexPosition( 1, 0, -1) ; vertex number 3

note here in MeshFace(2,3,0) we have referred to vertex 2 and vertex 0 which are used before
but in GLXtractor capturing it is considered as a new points, and inside OBJ file we see:
g 1
v -1.000000 0.000000 -1.000000
v -1.000000 0.000000 1.000000
v 1.000000 0.000000 1.000000
f 1 2 3
v 1.000000 0.000000 1.000000
v 1.000000 0.000000 -1.000000
v -1.000000 0.000000 -1.000000
f 4 5 6

these data if the camera in 0,0,0 and the entity in 0,0,0. the rendered data is different for other camera or entity positions or if the entity is rotated the data will be different but the shape stay as the original one.

so there are more vertices using the GLXtractor, and if we add the normals and the UV the OBJ will grow to gigantic sizes for big meshes. your only choice is to use the great MeshLab tool to reduce the number of vertices again, in the above OBJ file the vertices will be again 4. using the MeshLab Filters -> Cleaning and Repairing -> Merge Close Vertices

GLXtractor is a GUI for the OGLE the OpenGLExtractor tool, download Ogle bin and src from the Links provided here:
Ogle is using glintercept tool: GLIntercept is a OpenGL function call interceptor for Windows that will intercept and log all OpenGL calls:

How to capture DX
3D Ripper 0.1 beta :
i have tested it and it works, with PB Ogre 3D compiled as DirectX 9 subsytem (the default)
i was not able to save as OBJ, but at least it produce a material file *.mtl which the other tools does not provide

your notes and experience is very welcome

Re: OGRE tools

Posted: Sat Nov 09, 2019 9:48 pm

Re: OGRE tools

Posted: Sun Nov 10, 2019 1:29 am
by oreopa
Trying out ArtifexTerra3D just now. Looks good. Just what I was looking for to further my 3D "game". Thanks for that one!

Knew about SpaceScape, but it is also really good. Got some excellent looking skyboxes out of it.