Ogre 1.0.3 Beta available for testing

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

in the doc i can read
CreateEntity(#Entity)

If the #Entity was already created, it is automatically freed and replaced by the new one.
In the MeshManual.pb example I try to replace the entity :

Code: Select all

    CreateEntity(1, MeshID(0), MaterialID(0))
    EntityLocate(1,0,0,0)
    ScaleEntity(1, 3, 1, 3)
    ;FreeEntity(1) 
    CreateEntity(1, MeshID(0), MaterialID(0))
    EntityLocate(1,400,0,0)
I must add FreeEntity(1) to see the new entity

Code: Select all

FreeEntity(1) 
Please correct my english
http://purebasic.developpez.com/
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

can't load a map .bsp with LoadWord() , the same map work fine with the old enginedll.
Please correct my english
http://purebasic.developpez.com/
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

Comtois wrote:can't load a map .bsp with LoadWord() , the same map work fine with the old enginedll.
from Fred's first post that opened this thread:
Fred wrote:LoadWord() (ie BSP support) doesn't work anymore as DX7 renderer doesn't support the 32 bits hardware vertex buffers (only 16 bits limited)
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Exact, I did not remember it, thank you.
Please correct my english
http://purebasic.developpez.com/
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

In MeshManual.pb i try #PB_any , work fine for the first entity , but if i add a second entity , i get an error :?

[ERROR] specified #Entity is not initialised.

Code: Select all

    NoEntity=CreateEntity(#PB_Any, MeshID(0), MaterialID(0))
    EntityLocate(NoEntity,0,0,0)
    
    NoEntity=CreateEntity(#PB_Any, MeshID(0), MaterialID(0))
    EntityLocate(NoEntity,200,0,0)

So i try FreeEntity(NoEntity) before created the second entity and i get a big crash.

Code: Select all

    NoEntity=CreateEntity(#PB_Any, MeshID(0), MaterialID(0))
    EntityLocate(NoEntity,0,0,0)
    
    FreeEntity(NoEntity)
        
    NoEntity=CreateEntity(#PB_Any, MeshID(0), MaterialID(0))
    EntityLocate(NoEntity,200,0,0)
Please correct my english
http://purebasic.developpez.com/
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

I try SkyBox.pb, it's weird :?


[French]
ça fonctionnait très bien avec l'ancienne lib.
Avec la version beta , la planète bleue est mal affichée ,une moitié d'un côté, l'autre moitié de l'autre côté de la box [/French]

[EDIT]
Fred wrote:About the skybox, the files needed by the skybox needs to be slightly changed (look at the skybox files found in the Ogre demo package 1.0.3 on ogre3d.net, they work as expected)
Ok , i must read again all post :)
Last edited by Comtois on Sun Nov 27, 2005 3:28 pm, edited 1 time in total.
Please correct my english
http://purebasic.developpez.com/
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Small demo (only exe for the moment) , show two bugs :
- The skyBox
- SomeTime , Entity (wall) is not drawing ( if i incline camera down )

http://perso.wanadoo.fr/comtois/sources/VisuMap3D3.zip

[EDIT]
Fred wrote:About the skybox, the files needed by the skybox needs to be slightly changed (look at the skybox files found in the Ogre demo package 1.0.3 on ogre3d.net, they work as expected)
ok work fine now
Last edited by Comtois on Sun Nov 27, 2005 3:34 pm, edited 1 time in total.
Please correct my english
http://purebasic.developpez.com/
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

nice! That map editor rocks :D i know its simple but it does work hehe
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Two people said to me that they did not see the walls. In this demonstration I created a meshe by wall to manage coordinates UV of texture. there are 90 meshes and 90 entity. Which are the limits?
Please correct my english
http://purebasic.developpez.com/
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

It desn't start here it says it needs the engine3d.dll but after I put it into its directoy it still doesn't work. Map Editor works.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

You need the engine3D.Dll beta (ogre 1.03) and stlport_vc646.dll
Please correct my english
http://purebasic.developpez.com/
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Dräc
Enthusiast
Enthusiast
Posts: 150
Joined: Sat Oct 09, 2004 12:10 am
Location: Toulouse (France)
Contact:

Post by Dräc »

Comtois wrote:@Fred

I try to add this in the shadow.pb example :

Code: Select all

CameraProjection(0,#PB_Camera_Orthographic)
i see nothing , how does it work ? can you show a example ?

Btw, a cameraProjection would be nice for projection 3D-2D or 2D-3D.
for example to to obtain the position of a entity on the screen
Or to select a entity with mouse.
Any correction planned ?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It should work with the v4, here is a sample:

Code: Select all

#CameraSpeed = 10

IncludeFile "Screen3DRequester.pb"

Define.f KeyX, KeyY, MouseX, MouseY

If InitEngine3D()

  Add3DArchive("Data\", #PB_3DArchive_FileSystem)
  
  InitSprite()
  InitKeyboard()
  InitMouse()
  
  If Screen3DRequester()
    
    WorldShadows(#PB_Shadow_Additive) ; Set the shadow mode for the world
    
    AmbientColor(RGB(128,128,128))
    
    ; Create a plan, manually
    ;
    CreateMesh(1,100)
    SetMeshData(1, #PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_UVCoordinate, ?PlanVertices, 4)
    SetMeshData(1, #PB_Mesh_Face, ?PlanFaces, 2)
    
    LoadMesh   (0, "Robot.mesh")
    LoadTexture(0, "r2skin.jpg")
    
    CreateEntity (0, MeshID(0), CreateMaterial(0, TextureID(0)))
    AnimateEntity(0, "Walk")

    CreateMaterial(1, LoadTexture(1, "Background.png"))
    CreateEntity (1, MeshID(1), MaterialID(1))
    
    EntityRenderMode(1, 0) ; Disable shadow casting for this entity as it's our plan
    ScaleEntity(1, 1000, 1, 1000)
    MoveEntity(1, -500, 0, -500)
    DisableMaterialLighting(1, #False)
    
    CreateLight(0, RGB(255,255,255))
    
    CreateCamera(0, 0, 0, 100, 100)
    CameraLocate(0, 2000, 2000, 2000) ; 3D iso view
    CameraLookAt(0, 0, 0, 0)
    
    ResizeEntity(0, 4, 4, 4)
    
    CameraProjection(0, #PB_Camera_Orthographic)
    
    LightLocate(0, CameraX(0), CameraY(0), CameraZ(0))
      
    Repeat
      Screen3DEvents()
      
      ClearScreen(RGB(0, 0, 0))
            
      If ExamineKeyboard()
        
        If KeyboardPushed(#PB_Key_Up)
          EntityLocate(0, ex, 0, 0)
          ex+3
        EndIf
        
        If KeyboardPushed(#PB_Key_Down)
          EntityLocate(0, ex, 0, 0)
          ex-3
        EndIf


      EndIf
      
      If ExamineMouse()
        ;MouseX = -(MouseDeltaX()/10)*#CameraSpeed/2
        ;MouseY = -(MouseDeltaY()/10)*#CameraSpeed/2
      EndIf
            
      RenderWorld()      
        
      Screen3DStats()
      FlipBuffers()
    Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
  EndIf
    
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
  
End

DataSection

  PlanVertices:
    
    ; Note normals are important component to allow correct light support (and therefore shadow)
    ;
    Data.f 0, 0, 0    ; Vertex 0
    Data.f 1, 1, 1    ; Normals (perpendicular to the plan)
    Data.f 0   , 0.33 ; UVCoordinate
    
    Data.f 1, 0, 0    ; Vertex 1
    Data.f 1,1,1      ; Normals
    Data.f 0.33, 0.33 ; UVCoordinate
    
    Data.f 1, 0, 1    ; Vertex 2
    Data.f 1,1,1      ; Normals
    Data.f 0.33, 0    ; UVCoordinate
    
    Data.f 0, 0, 1    ; Vertex 3
    Data.f 1,1,1      ; Normals
    Data.f 0,    0    ; UVCoordinate

  PlanFaces:
    Data.w 2, 1, 0 ; bottom face (clockwise as it's reversed...)
    Data.w 0, 3, 2 

EndDataSection
Dräc
Enthusiast
Enthusiast
Posts: 150
Joined: Sat Oct 09, 2004 12:10 am
Location: Toulouse (France)
Contact:

Post by Dräc »

Works fine, my mistake...
Thank you very much for the sample which corrects me, Fred !
Post Reply