I cannot drawing sprites on 3D
I cannot drawing sprites on 3D
I do ... a merging mesh.pb + sprite.pb
but sprite cannot be drawed with 3d mesh
Is it impossible?
but sprite cannot be drawed with 3d mesh
Is it impossible?
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
mesh+sprite?
i tested examples, and merged examples. that is below
and run. no bug...but sprite is not displayed????
I want to see 2d sprites & 3d mesh together.....
Code: Select all
; mesh.pd
...
...
If InitEngine3D()
Add3DArchive("Data\" , #PB_3DArchive_FileSystem)
Add3DArchive("Data\Skybox.zip", #PB_3DArchive_Zip)
InitSprite()
InitKeyboard()
InitMouse()
...
;sprirte.pb
LoadSprite(0, "Data\PureBasic.bmp", 0)
CopySprite(0,1,0)
...
...
..
; mesh.pd
Repeat
Screen3DEvents()
...
...
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
Screen3DStats()
;;;;;;;;;sprite.pb
DisplaySprite(0, x, 100)
DisplaySprite(1, x, x)
DisplaySprite(0, 600-x, x)
x+1
;;;;;;;;;mesh.pb
FlipBuffers()
I want to see 2d sprites & 3d mesh together.....
You have to call displaysprite() after renderworld() and before flipbuffers() and it should work:
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Entity
;
; (c) 2002 - Fantaisie Software
;
; ------------------------------------------------------------
;
IncludeFile "Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
Add3DArchive("Data\" , #PB_3DArchive_FileSystem)
Add3DArchive("Data\Skybox.zip", #PB_3DArchive_Zip)
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
LoadMesh (0, "Robot.mesh")
; Load a sprite here
;
LoadSprite(0, x"c:\8bits.bmp"x)
CreateMaterial(0, LoadTexture(0, "clouds.jpg"))
CreateMaterial(1, LoadTexture(1, "r2skin.jpg"))
CreateEntity(0, MeshID(0), MaterialID(0))
CreateEntity(1, MeshID(0), MaterialID(1), -60, 0, 0)
CreateEntity(2, MeshID(0), MaterialID(1), 60, 0, 0)
AnimateEntity(0, "Walk")
SkyBox("desert07.jpg")
CreateCamera(0, 0, 0, 100, 100)
CameraLocate(0,0,0,100)
Repeat
Screen3DEvents()
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(1, 1, 0, 0)
RotateEntity(2, 1, 0, 0)
RotateCamera(0, MouseX, MouseY, RollZ)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
; Here is the sprite..
;
DisplaySprite(0, 0, 0)
Screen3DStats()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
thank you Fred
your code works well...
exception define.f, clearscreen(rgb(0,0,0))
thankyou
exception define.f, clearscreen(rgb(0,0,0))
thankyou
(very powerful and cool =)
Yep you were right Gaman, and it wasn't intentional so I deleted it here and posted it in a new topic hoping it would be seen. But I guess I never actually hit the submit on this one (to erase it). Sorry yer right, my bad!
And btw, problem all solved now. Pm me or email me sometime Gaman and I'll let you in on a (very powerful and cool =) secret that I came up with using what we figured out (geesh that was painful, so glad it's over now!) along with a (very powerful and cool =) dll I wrote in PB a while back. You were cool about things at the end of that pointless flamefest, and even though I didn't like being falsely accused of things, I respect that you owned up/manned up at the end, that took guts (and maturity). Thanks (and seriously you'll be blown away with what I show you, the potential is HUGE, and I've been doing 3D dev since the first 3Dfx card came out in beta, I know it's revolutionary (and by the way, it's (very powerful and cool =) hehheh. Seriously tho, Plz contact me for it! I'll give you a free ver of the DLL that I sell and show you how to combine them). You will smile broadly.
And btw, problem all solved now. Pm me or email me sometime Gaman and I'll let you in on a (very powerful and cool =) secret that I came up with using what we figured out (geesh that was painful, so glad it's over now!) along with a (very powerful and cool =) dll I wrote in PB a while back. You were cool about things at the end of that pointless flamefest, and even though I didn't like being falsely accused of things, I respect that you owned up/manned up at the end, that took guts (and maturity). Thanks (and seriously you'll be blown away with what I show you, the potential is HUGE, and I've been doing 3D dev since the first 3Dfx card came out in beta, I know it's revolutionary (and by the way, it's (very powerful and cool =) hehheh. Seriously tho, Plz contact me for it! I'll give you a free ver of the DLL that I sell and show you how to combine them). You will smile broadly.

Last edited by vrman3d on Fri Jul 27, 2007 7:46 pm, edited 1 time in total.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany