[not a bug] PB5.30B9 Entity DisplaySkeleton don't match.

Everything related to 3D programming
box_80
Enthusiast
Enthusiast
Posts: 117
Joined: Mon Sep 03, 2012 8:52 pm

[not a bug] PB5.30B9 Entity DisplaySkeleton don't match.

Post by box_80 »

All 3 entities have skeletons. But All 3 skeletons show in only one place and none of the 2 skeletons rotate like the mesh it is used for. I tested with PB 5.30 Beta 9 on Win XP Pro. (x86). The code was also tested on PB 5.20 x86 and x64 on windows 7.

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - Entity
;
;    (c) 2002 - Fantaisie Software
;
; ------------------------------------------------------------
;

#CameraSpeed = 1

IncludeFile "Screen3DRequester.pb"

Define.f KeyX, KeyY, MouseX, MouseY, RollZ


If InitEngine3D()
 
  Add3DArchive("Data/Textures", #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Models", #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Packs/skybox.zip", #PB_3DArchive_Zip)
 
  InitSprite()
  InitKeyboard()
  InitMouse()
 
  If Screen3DRequester()
   
    LoadMesh(0, "robot.mesh")
   
   
    CreateMaterial(0, LoadTexture(0, "clouds.jpg"))
    CopyMaterial(0, 1)
    CreateMaterial(2, LoadTexture(2, "r2skin.jpg"))
    MaterialShadingMode(0, #PB_Material_Wireframe)
    MaterialShadingMode(2, #PB_Material_Wireframe)
   
   
    CreateEntity(0, MeshID(0), MaterialID(0))
    CreateEntity(1, MeshID(0), MaterialID(1), -60, 0, 0)
    CreateEntity(2, MeshID(0), MaterialID(2), 60, 0, 0)
   
    StartEntityAnimation(0, "Walk")
   
    EntityRenderMode(0, #PB_Entity_DisplaySkeleton)
    EntityRenderMode(1, #PB_Entity_DisplaySkeleton)
    EntityRenderMode(2, #PB_Entity_DisplaySkeleton)
    MoveEntity(0, 60, 0, 30)
   
   
   
    SkyBox("stevecube.jpg")
   
   
    CreateCamera(0, 0, 0, 100, 100)
    MoveCamera(0, 0, 40, 150, #PB_Absolute)
   
    Repeat
      Screen3DEvents()
     
      If ExamineMouse()
        MouseX = -MouseDeltaX() * #CameraSpeed * 0.05
        MouseY = -MouseDeltaY() * #CameraSpeed * 0.05
      EndIf
     
      If ExamineKeyboard()
       
        If KeyboardPushed(#PB_Key_Left)
          KeyX = -#CameraSpeed
        ElseIf KeyboardPushed(#PB_Key_Right)
          KeyX = #CameraSpeed
        Else
          KeyX = 0
        EndIf
       
        If KeyboardPushed(#PB_Key_Up)
          KeyY = -#CameraSpeed
        ElseIf KeyboardPushed(#PB_Key_Down)
          KeyY = #CameraSpeed
        Else
          KeyY = 0
        EndIf   
       
       
      EndIf
     
      RotateEntity(1, 0, 1, 0, #PB_Relative)
      RotateEntity(2, 0, 1, 0, #PB_Relative)
     
      RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
      MoveCamera  (0, KeyX, 0, KeyY)
     
      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
Last edited by box_80 on Tue Jul 22, 2014 10:12 pm, edited 1 time in total.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: [PB5.30B9] Entity DisplaySkeleton don't match entity.

Post by Comtois »

It's not a PB's bug. Extract from ogre :
// HACK To display bones
// This won't work if the entity is not centered at the origin
// TODO work out a way To allow bones To be rendered when Entity Not centered
http://www.purebasic.fr/english/viewtop ... 36&t=51947
Please correct my english
http://purebasic.developpez.com/
box_80
Enthusiast
Enthusiast
Posts: 117
Joined: Mon Sep 03, 2012 8:52 pm

Re: [PB5.30B9] Entity DisplaySkeleton don't match entity.

Post by box_80 »

Thanks for explaining this. Also that link was very useful. :D
Hope the edit to the title is correct. Because this problem being more of a OGRE bug, that can be worked around with other code.
Post Reply