Page 1 of 2

[4.60] Static Geometry

Posted: Tue Apr 05, 2011 8:42 pm
by G-Rom
This sample show how to use Static Geometry ( need graphics card support batching geometry )

some problem with rapidshare ( download limit )
hosted on google code now :
http://code.google.com/p/purebasic-ogre ... loads/list

Command:
Arrow to move , maj to boost , mouse for look.


Linux user, don't forget to use opengl subsystem.

if you have any problem , report the Ogre.log here please.

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 2:03 pm
by G-Rom
Not tested yet ? :shock:

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 2:09 pm
by eesau
I'll test as soon as I get home :wink:

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 3:07 pm
by TomS
What's with the missing d3dx9_42.dll ?
I have DirectX 11 installed on my Windows7

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 3:13 pm
by eesau
TomS wrote:What's with the missing d3dx9_42.dll ?
I have DirectX 11 installed on my Windows7
Please read the part about the DX9 runtimes in Freak's announcement, here.

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 3:17 pm
by eesau
G-Rom: nice demos, run fine and look great! No problems at all.

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 3:44 pm
by TomS
Thank you, eesau.
Is this package only for developing or do end-users have to download it, too?

Nice demo G-Rom. I'm looking forward to the updated help file to start experimenting a bit myself.
Would it be hard to paint a texture onto the cuboids or does one have to use .mesh files again?

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 4:02 pm
by DarkDragon
Invalid memory access at InitEngine3D() with Windows 7 x64.

Here is my Ogre.log:

Code: Select all

17:01:11: Creating resource group General
17:01:11: Creating resource group Internal
17:01:11: Creating resource group Autodetect
17:01:11: SceneManagerFactory for type 'DefaultSceneManager' registered.
17:01:11: Registering ResourceManager for type Material
17:01:11: Registering ResourceManager for type Mesh
17:01:11: Registering ResourceManager for type Skeleton
17:01:11: MovableObjectFactory for type 'ParticleSystem' registered.
17:01:11: OverlayElementFactory for type Panel registered.
17:01:11: OverlayElementFactory for type BorderPanel registered.
17:01:11: OverlayElementFactory for type TextArea registered.
17:01:11: Registering ResourceManager for type Font
17:01:11: ArchiveFactory for archive type FileSystem registered.
17:01:11: ArchiveFactory for archive type Zip registered.
17:01:11: FreeImage version: 3.10.0
17:01:11: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
17:01:11: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,koa,iff,lbm,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,dds,gif,g3,sgi,j2k,j2c,jp2
17:01:11: DDS codec registering
17:01:11: Registering ResourceManager for type HighLevelGpuProgram
17:01:11: Registering ResourceManager for type Compositor
17:01:11: MovableObjectFactory for type 'Entity' registered.
17:01:11: MovableObjectFactory for type 'Light' registered.
17:01:11: MovableObjectFactory for type 'BillboardSet' registered.
17:01:11: MovableObjectFactory for type 'ManualObject' registered.
17:01:11: MovableObjectFactory for type 'BillboardChain' registered.
17:01:11: MovableObjectFactory for type 'RibbonTrail' registered.
17:01:11: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
17:01:11: plugins.cfg not found, automatic plugin loading disabled.
17:01:11: *-*-* OGRE Initialising
17:01:11: *-*-* Version 1.6.2 (Shoggoth)
17:01:11: D3D9 : Direct3D9 Rendering Subsystem created.
17:01:11: D3D9: Driver Detection Starts
17:01:11: D3D9: Driver Detection Ends
17:01:11: Particle Emitter Type 'Point' registered
17:01:11: Particle Emitter Type 'Box' registered
17:01:11: Particle Emitter Type 'Ellipsoid' registered
17:01:11: Particle Emitter Type 'Cylinder' registered
17:01:11: Particle Emitter Type 'Ring' registered
17:01:11: Particle Emitter Type 'HollowEllipsoid' registered
17:01:11: Particle Affector Type 'LinearForce' registered
17:01:11: Particle Affector Type 'ColourFader' registered
17:01:11: Particle Affector Type 'ColourFader2' registered
17:01:11: Particle Affector Type 'ColourImage' registered
17:01:11: Particle Affector Type 'ColourInterpolator' registered
17:01:11: Particle Affector Type 'Scaler' registered
17:01:11: Particle Affector Type 'Rotator' registered
17:01:11: Particle Affector Type 'DirectionRandomiser' registered
17:01:11: Particle Affector Type 'DeflectorPlane' registered
17:01:11: CPU Identifier & Features
17:01:11: -------------------------
17:01:11:  *   CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad CPU           @ 2.40GHz
17:01:11:  *      SSE: yes
17:01:11:  *     SSE2: yes
17:01:11:  *     SSE3: yes
17:01:11:  *      MMX: yes
17:01:11:  *   MMXEXT: yes
17:01:11:  *    3DNOW: no
17:01:11:  * 3DNOWEXT: no
17:01:11:  *     CMOV: yes
17:01:11:  *      TSC: yes
17:01:11:  *      FPU: yes
17:01:11:  *      PRO: yes
17:01:11:  *       HT: no
17:01:11: -------------------------
17:01:11: D3D9 : Subsystem Initialising
17:01:11: ***************************************
17:01:11: *** D3D9 : Subsystem Initialised OK ***
17:01:11: ***************************************
17:01:11: SceneManagerFactory for type 'OctreeSceneManager' registered.
17:01:11: SceneManagerFactory for type 'TerrainSceneManager' registered.
17:01:11: SceneManagerFactory for type 'BspSceneManager' registered.
17:01:11: Registering ResourceManager for type BspLevel
If I compile it with the x86 compiler it works without problems. Btw.: nice examples.

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 4:18 pm
by G-Rom
TomS wrote:Nice demo G-Rom. I'm looking forward to the updated help file to start experimenting a bit myself.
Would it be hard to paint a texture onto the cuboids or does one have to use .mesh files again?
you want paint directly on the mesh ? or make the mesh manualy ?

DarkDragon
@Thk , i think the bug is the bsp level manager ( no supported )

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 4:32 pm
by TomS
I want to create simple geometry on the fly with the new Create???() commands without having to use an external programm to create meshes.
In fact I want to create something like this: http://www.youtube.com/watch?v=jlUFalof ... re=related
Everything in this scene except the "people" can be created out of simple geometric forms like cuboids and cylinders.

I simply want to paint an image onto some of the objects, like the wooden floor in the video.
Without using any resources except for the image (no .mesh files).

Something like this:

Code: Select all

image = LoadImage(#PB_Any, "File.bmp")
mesh = CreateCube(10)
PaintMesh(mesh, image)

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 4:56 pm
by DarkDragon
TomS wrote:I want to create simple geometry on the fly with the new Create???() commands without having to use an external programm to create meshes.
In fact I want to create something like this: http://www.youtube.com/watch?v=jlUFalof ... re=related
Everything in this scene except the "people" can be created out of simple geometric forms like cuboids and cylinders.

I simply want to paint an image onto some of the objects, like the wooden floor in the video.
Without using any resources except for the image (no .mesh files).

Something like this:

Code: Select all

image = LoadImage(#PB_Any, "File.bmp")
mesh = CreateCube(10)
PaintMesh(mesh, image)
I've modified the mesh example for you:

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - Mesh (Skeleton Animation)
;
;    (c) 2002 - Fantaisie Software
;
; ------------------------------------------------------------
;
; Modified by DarkDragon for TomS

Define.f KeyX, KeyY, MouseX, MouseY

#RobotTexture = 0
#Robot        = 0
  
If InitEngine3D()

  Add3DArchive(#PB_Compiler_Home + "Examples/Sources/Data", #PB_3DArchive_FileSystem)
  
  InitSprite()
  InitKeyboard()
  InitMouse()
  
  If OpenWindow(0, #PB_Ignore, #PB_Ignore, 800, 600, "Test", #PB_Window_TitleBar)
    If OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 1, 0, 0)
      
      CreateCube(#Robot, 10.0)
      LoadTexture(#RobotTexture, "clouds.jpg")
      
      CreateMaterial(0, TextureID(#RobotTexture))
      
      CreateEntity(#Robot, MeshID(#Robot), MaterialID(0))
      
      CreateLight(0, RGB(0,0,255), 100.0, 50.0, 100.0)
      LightSpecularColor(0, RGB(255, 0, 0))
      
      CreateCamera(0, 0, 0, 100, 100)
      CameraLocate(0, 50, 100, 100)
      CameraLookAt(0, 0, 0, 0)
        
      Repeat
        WindowEvent()
        
        ClearScreen(RGB(0, 0, 0))
              
        If ExamineKeyboard()
        
          If KeyboardPushed(#PB_Key_Left)
            KeyX = -1
          ElseIf KeyboardPushed(#PB_Key_Right)
            KeyX = 1
          Else
            KeyX = 0
          EndIf
          
          If KeyboardPushed(#PB_Key_Up)
            KeyY = -1
          ElseIf KeyboardPushed(#PB_Key_Down)
            KeyY = 1
          Else
            KeyY = 0
          EndIf
          
          If KeyboardPushed(#PB_Key_PageUp)
            RollZ = 3
          Else
            RollZ = 0
          EndIf
          
          If KeyboardPushed(#PB_Key_Add)
            Frame.f+0.005
          EndIf
          
        EndIf
        
        If ExamineMouse()
          MouseX = -MouseDeltaX()/10 
          MouseY = -MouseDeltaY()/10
        EndIf
        
        RotateEntity(#Robot, 0.0, 1.0, 0.0, #PB_Relative)
        
        RotateCamera(0, MouseY, MouseX, RollZ, #PB_Relative)
        MoveCamera  (0, KeyX, 0, KeyY)
        
        RenderWorld()
        FlipBuffers()
      Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
    EndIf
  EndIf
    
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
  
End

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 5:04 pm
by TomS
Thank you, Dark Dragon.
Have to play around with this :)

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 7:08 pm
by PMV
If i free an staticgeometry and recreate another one
(not every time i recreate it, but after 2 or 3)

... i get this in the OGRE.log after a big crash:
19:47:32: OGRE EXCEPTION(4:ItemIdentityException): StaticGeometry with name 'STG_47779024' already exists! in SceneManager::createStaticGeometry at OgreSceneManager.cpp (line 6266)
(sorry, not enough time to create a full bug-report)

MFG PMV

Re: [4.60] Static Geometry

Posted: Wed Apr 06, 2011 7:53 pm
by G-Rom
Thk , Fixed.

Re: [4.60] Static Geometry

Posted: Sat Apr 16, 2011 1:10 pm
by PMV
When i compile my game with debugger enabled (PB4.60 B2 x86)
and use my StaticGeometry-Test, i get a crash at the third
"CreateStaticGeometry()" call. It happens without freeing previous
StaticGeometry. The OGRE-Log says this:
14:06:43: OGRE EXCEPTION(4:ItemIdentityException): StaticGeometry with name 'STG_' already exists! in SceneManager::createStaticGeometry at OgreSceneManager.cpp (line 6266)
MFG PMV