It is currently Thu Nov 27, 2014 10:11 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 10:09 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
Still can't test (those 2 lines does not change a thing respect your original code). Tried on 2 different PCs, PB 4.60RC1.
Same behaviour in both machines: full graphic screen does not appear and debugger does not complain.

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 10:58 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 02, 2003 9:16 am
Posts: 1916
Location: Germany
Psychophanta wrote:
Still can't test (those 2 lines does not change a thing respect your original code).
Have you changed what I told you to? Set fixed resolution instead of those 2 lines.

Psychophanta wrote:
Tried on 2 different PCs, PB 4.60RC1.
Same behaviour in both machines: full graphic screen does not appear and debugger does not complain.


How about this?
Code:
Macro Check(Status, Error, EndProgram = 1)
  If Not Status
    MessageRequester("ERROR", Error)
    CompilerIf EndProgram
      End
    CompilerEndIf
  EndIf
EndMacro

Structure MeshVertex
  X.f
  Y.f
  Z.f
EndStructure

Structure MeshNormal
  X.f
  Y.f
  Z.f
EndStructure

Structure MeshColor
  RGB.l
EndStructure

Structure MeshUV
  U.f
  V.f
EndStructure

Structure MeshFace
  V1.i
  V2.i
  V3.i
EndStructure

Procedure.i CreateMeshEx(Mesh.i, *PointerVertex.MeshVertex, *PointerColor.MeshColor, *PointerNormal.MeshNormal, *PointerUV.MeshUV, *PointerFace.MeshFace, Vertices.i, Faces.i)
  Protected K.i
  Protected MeshNumber.i
  Protected Result.i = 0
 
  If *PointerVertex = #Null Or *PointerFace = #Null
    ProcedureReturn Result
  EndIf
 
  If Mesh = #PB_Any
    MeshNumber = CreateMesh(Mesh)
    Result = MeshNumber
  Else
    Result = CreateMesh(Mesh)
    MeshNumber = Mesh
  EndIf
 
  If Result <> 0
    AddSubMesh()
   
    For K = 1 To Vertices
      AddMeshVertex(*PointerVertex\X, *PointerVertex\Y, *PointerVertex\Z)
     
      If *PointerColor <> #Null
        MeshVertexColor(*PointerColor\RGB)
        *PointerColor + SizeOf(MeshColor)
      EndIf
     
      If *PointerNormal <> #Null
        MeshVertexNormal(*PointerNormal\X, *PointerNormal\Y, *PointerNormal\Z)
        *PointerNormal + SizeOf(MeshNormal)
      EndIf
     
      If *PointerUV <> #Null
        MeshVertexTextureCoordinate(*PointerUV\U, *PointerUV\V)
        *PointerUV + SizeOf(MeshUV)
      EndIf
     
      *PointerVertex + SizeOf(MeshVertex)
    Next K
   
    For K = 1 To Faces
      AddMeshFace(*PointerFace\V1, *PointerFace\V2, *PointerFace\V3)
      *PointerFace + SizeOf(MeshFace)
    Next K
   
    FinishMesh()
  EndIf
 
  ProcedureReturn Result
EndProcedure

Check(InitEngine3D(), "InitEngine3D failed.")
Check(InitSprite(), "InitSprite failed.")
Check(InitKeyboard(), "InitKeyboard failed.")

OpenWindow(0, 0, 0, 800, 600, "", #PB_Window_SystemMenu)
Check(OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 1, 0, 0), "OpenWindowedScreen failed.")

WorldShadows(#PB_Shadow_Modulative)

CreateTexture(0, 64, 64)
StartDrawing(TextureOutput(0))
Box(0, 0, 32, 32, RGB(0, 0, 255))
Box(32, 0, 32, 32, RGB(0, 255, 0))
Box(32, 32, 32, 32, RGB(255, 0, 0))
Box(0, 32, 32, 32, RGB(255, 255, 0))
StopDrawing()

CreateMaterial(0, TextureID(0))

CreateMeshEx(0, ?DataVertices, #Null, ?DataNormal, ?DataUV, ?DataFaces, 4, 2)
Check(CreateEntity(0, MeshID(0), MaterialID(0)), "CreateEntity failed")

CreateLight(0, RGB(255, 255, 255), 100.0, 0, 0)
LightSpecularColor(0, RGB(255, 0, 0))

Check(CreateCamera(0, 0, 0, 100, 100), "CreateCamera failed")

CameraLocate(0, 5, 5, -10)
CameraLookAt(0, 0, 0, 0)

Define Timer = ElapsedMilliseconds()
Define Mode = 0

Repeat
  ClearScreen(0)
  RenderWorld()
  FlipBuffers()
 
  If ElapsedMilliseconds() - Timer > 1000
    If Mode = 0
      CreateMeshEx(0, ?DataVertices2, #Null, ?DataNormal, ?DataUV2, ?DataFaces, 3, 1)
      Check(CreateEntity(0, MeshID(0), MaterialID(0)), "CreateEntity failed")
      Mode = 1
    Else
      CreateMeshEx(0, ?DataVertices, #Null, ?DataNormal, ?DataUV, ?DataFaces, 4, 2)
      Check(CreateEntity(0, MeshID(0), MaterialID(0)), "CreateEntity failed")
      Mode = 0
    EndIf
    Timer = ElapsedMilliseconds()
  EndIf
 
  ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape) Or WindowEvent() = #PB_Event_CloseWindow
End

DataSection
  DataVertices:
    Data.f -0.5,  0.5,  0.0
    Data.f  0.5,  0.5,  0.0
    Data.f  0.5, -0.5,  0.0
    Data.f -0.5, -0.5,  0.0
   
  DataVertices2:
    Data.f -0.75,  0.75,  0.0
    Data.f  0.75,  0.75,  0.0
    Data.f  0.75, -0.75,  0.0
    Data.f -0.75, -0.75,  0.0
   
  DataNormal:
    Data.f  0.0,  0.0,  1.0
    Data.f  0.0,  0.0,  1.0
    Data.f  0.0,  0.0,  1.0
    Data.f  0.0,  0.0,  1.0
   
  DataUV:
    Data.f  0.0,  0.0
    Data.f  1.0,  0.0
    Data.f  1.0,  1.0
    Data.f  0.0,  1.0
   
  DataUV2:
    Data.f  1.0,  1.0
    Data.f  0.0,  1.0
    Data.f  0.0,  0.0
    Data.f  1.0,  0.0
   
  DataFaces:
    Data.i 0, 1, 2
    Data.i 0, 2, 3
EndDataSection

_________________
bye,
Daniel

http://www.bradan.eu/


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 11:42 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
DarkDragon wrote:
Have you changed what I told you to? Set fixed resolution instead of those 2 lines.
Of course.

DarkDragon wrote:
How about this?
Same, but windowed. The window appears halted, nothing is displayed there.

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 12:03 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Aug 19, 2003 11:36 am
Posts: 1286
Location: Doubs - France
And your ogre.log say what ?

_________________
Please correct my english
http://purebasic.developpez.com/


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 12:23 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
Comtois wrote:
And your ogre.log say what ?

Quote:
13:21:48: DefaultWorkQueue('Root') initialising on thread main.
13:21:48: Particle Renderer Type 'billboard' registered
13:21:48: Can't assign material none to SubEntity of E0 because this Material does not exist. Have you forgotten to define it in a .material script?
13:21:48: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
13:21:48: OGRE EXCEPTION(7:InternalErrorException): Cannot create D3D9 vertex declaration: An undetermined error occurred in Direct3D9VertexDeclaration::getD3DVertexDeclaration at OgreD3D9VertexDeclaration.cpp (line 162)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
13:21:48: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
...
...

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 3:05 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Aug 19, 2003 11:36 am
Posts: 1286
Location: Doubs - France
does MeshManual.pb or MeshManualFred.pb work for you ? or you get the same ogre.log ?

_________________
Please correct my english
http://purebasic.developpez.com/


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 4:36 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
Comtois wrote:
does MeshManual.pb or MeshManualFred.pb work for you ? or you get the same ogre.log ?

With MeshManualFred.pb
Quote:
17:31:24: Can't assign material none to SubEntity of E0 because this Material does not exist. Have you forgotten to define it in a .material script?
17:31:24: OGRE EXCEPTION(7:InternalErrorException): Cannot create D3D9 vertex declaration: An undetermined error occurred in Direct3D9VertexDeclaration::getD3DVertexDeclaration at OgreD3D9VertexDeclaration.cpp (line 162)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
...
...

In both computers.

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 6:12 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 02, 2003 9:16 am
Posts: 1916
Location: Germany
Did you try with a clean install of PB 4.60RC1 or did you install it over a previous release?

_________________
bye,
Daniel

http://www.bradan.eu/


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 6:30 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
DarkDragon wrote:
Did you try with a clean install of PB 4.60RC1 or did you install it over a previous release?

Clean,
but anyway i have had problems whenever i dealed with PB in 3D, since 3.xx versions... so i used other 3d libs with PB, but i found quickly some obstacle which avoid me to continue...
Damn! and still things are an obstacle itself when referring to 3D with PB.

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 7:54 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 24, 2007 3:15 pm
Posts: 693
Location: Germany
You need DX9 ... it doesn't come up with Vista or 7.
It is needed to be installed manually. And by the way,
can you post the whole log? :)


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sat Oct 08, 2011 9:54 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
PMV wrote:
You need DX9 ... it doesn't come up with Vista or 7.
It is needed to be installed manually. And by the way,
can you post the whole log? :)

I installed dx9 version which is posted in the PB4.6B1 announcement.
I use Win XP
The log is all full of these 2 lines until the end:
Quote:
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error Presenting surfaces in D3D9Device::present at OgreD3D9Device.cpp (line 991)
17:31:24: OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at OgreD3D9RenderSystem.cpp (line 2818)
nothing more.

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sun Oct 09, 2011 12:12 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 24, 2007 3:15 pm
Posts: 693
Location: Germany
I know what is inside of the log ... and there is much more
then errors. Just copy the whole file. I will see with my own
eyes, if there is nothing else important :wink:


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Wed Oct 19, 2011 11:22 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
MeshManual.pb and MeshManualFred.pb examples has the same behaviour with PB4.60RC2, i.e. halted screen.
The ogre.log

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sun Dec 04, 2011 12:39 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4169
Location: Spa, relaxing and thinking, and learning...
Very curious; 2 issues:
Last example from Darkdragon works in PB4.60 final with do not anything and without any kind of problem, so the only thing can be though is that it is pure luck it worked for you all in 4.60RC.
The example is frightenly slow (far to be a real time mesh modification), just as i figured out. So then i must continue to search the way how DX9 internals do to perform a mesh data real time modification.

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


While world=business:world+mafia:Wend


Top
 Profile  
 
 Post subject: Re: Needed engine3d internals info to build own SetMeshData(
PostPosted: Sun Dec 04, 2011 1:05 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 02, 2003 9:16 am
Posts: 1916
Location: Germany
Psychophanta wrote:
Very curious; 2 issues:
Last example from Darkdragon works in PB4.60 final with do not anything and without any kind of problem, so the only thing can be though is that it is pure luck it worked for you all in 4.60RC.
The example is frightenly slow (far to be a real time mesh modification), just as i figured out. So then i must continue to search the way how DX9 internals do to perform a mesh data real time modification.
Its not because of my solution, as it only can be about 2x slower than it would be with an internal solution. But this constant factor isn't of any matter. I think there must be something wrong with the PB OGRE bindings in general as some people are having runtime errors, you have some weird output and bugs, ... .

_________________
bye,
Daniel

http://www.bradan.eu/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: Baidu [Spider] and 6 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