MP3D Engine Alpha 33
Re: MP3D Engine Alpha 32
Hi Michael
i was writing my post above at the same time you was writing your post 12:08 pm _12:14 pm, so i have not seen it until today. great work and many new functions to test. i suggest a new installation file will be easier for the new users.
regards
i was writing my post above at the same time you was writing your post 12:08 pm _12:14 pm, so i have not seen it until today. great work and many new functions to test. i suggest a new installation file will be easier for the new users.
regards
Re: MP3D Engine Alpha 33
@MPZ: OMG! I about **** myself when I saw this update! THANK YOU SO MUCH FOR ADDING THREAD SAFE & UNICODE EXECUTABLES! =DDDD
Cannot WAIT to see what's in store for V.0.34!
Cannot WAIT to see what's in store for V.0.34!

Re: MP3D Engine Alpha 32
thank Michael for the Gear introduction, the example posted here http://www.purebasic.fr/english/viewtop ... 50#p424445 as a future plan now implemented
i have tested it, and want the gear to rotate under impulses such as MP_EntityAddImpulse(Mesh, 0, -0.03, 0 , -2.0,0, 0)
i propose the coordinates here as in this picture:

so the left gear are rotated and affect the right gear.
the 3 cubes are just a position sign
note that in MP_EntityPhysicBody(Mesh , 5, 10) there is number 5 which is a new type other than before, i hope it will work also with a dynamic holes such as a torus with a hole falling down over a stick, i will try that.
a logical wish is if there is a motor function will be great, i saw MP_EntitySetVelocity() but either i don't know how to use it or it does not work yet. the motor function like the EnableHingeJointAngularMotor used in the new example CarPhysic.pb in C:\PureBasic\Examples\3D\Demos
here is Michael demo run by "MP_EntityAddImpulse" to show the case. i have tried also a 2 gears like i have posted here http://www.purebasic.fr/english/viewtop ... 50#p421363
and runs but stuck too much, may be we need to reduce the triangles, so if successful i will post it.
PS: just now i saw Alexi asked about clothes here http://www.purebasic.fr/english/viewtop ... 36&t=57073 i saw somewhere a clothes demo and even a clothes which can be torn, are there clothes in DX ??
i have tested it, and want the gear to rotate under impulses such as MP_EntityAddImpulse(Mesh, 0, -0.03, 0 , -2.0,0, 0)
i propose the coordinates here as in this picture:

so the left gear are rotated and affect the right gear.
Code: Select all
;// Project Title: MP 3D Engine Beispielprogramme
;// Dateiname: MP_GearsTest.pb
;// Erstellt am: 30.8.2013
;// Update am :
;// Author: Michael Paulwitz
;//
;// Info:
;// Gear Test
;// Zahnrad Test
;//
;//
;////////////////////////////////////////////////////////////////
MP_Graphics3D (640,480,0,1)
SetWindowTitle(0, "MP3D Physik Gear Demo")
camera = MP_CreateCamera() ; Kamera erstellen
MP_PositionCamera(camera, 0, 5, -5 )
MP_CameraLookAt(camera,0,0,0)
light= MP_CreateLight(0) ; Es werde Licht
Mesh = MP_CreateRectangle (2,0.05,0.5)
Mesh2 = MP_CreateRectangle (2,0.05,0.5)
MP_RotateEntity(Mesh2 , 0 , 0, 60, 1) : MP_ChangeMeshCoord(Mesh2)
MP_AddMesh(Mesh2 , Mesh ) : MP_FreeEntity(Mesh2)
Mesh2 = MP_CreateRectangle (2,0.05,0.5)
MP_RotateEntity(Mesh2 , 0 , 0, 120, 1) : MP_ChangeMeshCoord(Mesh2)
MP_AddMesh(Mesh2 , Mesh ) : MP_FreeEntity(Mesh2)
MP_EntitySetNormals (Mesh)
MP_MaterialDiffuseColor (Mesh,255,255,128,50)
MP_MaterialSpecularColor (Mesh, 255, 255 ,255, 155,5)
Mesh2 = MP_CopyEntity(Mesh)
MP_PositionEntity (Mesh,-1.7,0,0)
MP_PositionEntity (Mesh2,0,0,0)
;MP_TurnEntity (Mesh2,0,0,30)
MP_PhysicInit()
MP_EntityPhysicBody(Mesh , 5, 10)
MP_ConstraintCreateHinge (Mesh,0,0,1)
MP_EntityPhysicBody(Mesh2, 5, 10)
MP_ConstraintCreateHinge (Mesh2,0,0,1)
MP_AmbientSetLight (RGB(0,100,200))
; those cubes are just place signs
Mesh4 = MP_CreateRectangle(0.2,0.2,0.2)
MP_PositionEntity (Mesh4,0,1.5,0)
Mesh5 = MP_CreateRectangle(0.2,0.2,0.2)
MP_PositionEntity (Mesh5,-1,1.5,0)
Mesh6 = MP_CreateRectangle(0.2,0.2,0.2)
MP_PositionEntity (Mesh6,-2,1.5,0)
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
;MP_TurnEntity(Mesh, 0, 0, 1 )
MP_EntityAddImpulse(Mesh, 0, -0.03, 0 , -2.0,0, 0)
MP_PhysicUpdate()
MP_RenderWorld() ; Erstelle die Welt
MP_Flip () ; Stelle Sie dar
Wend
MP_PhysicEnd()
note that in MP_EntityPhysicBody(Mesh , 5, 10) there is number 5 which is a new type other than before, i hope it will work also with a dynamic holes such as a torus with a hole falling down over a stick, i will try that.
a logical wish is if there is a motor function will be great, i saw MP_EntitySetVelocity() but either i don't know how to use it or it does not work yet. the motor function like the EnableHingeJointAngularMotor used in the new example CarPhysic.pb in C:\PureBasic\Examples\3D\Demos
here is Michael demo run by "MP_EntityAddImpulse" to show the case. i have tried also a 2 gears like i have posted here http://www.purebasic.fr/english/viewtop ... 50#p421363
and runs but stuck too much, may be we need to reduce the triangles, so if successful i will post it.
PS: just now i saw Alexi asked about clothes here http://www.purebasic.fr/english/viewtop ... 36&t=57073 i saw somewhere a clothes demo and even a clothes which can be torn, are there clothes in DX ??
Re: MP3D Engine Alpha 32
another play with gear demo, added an axes, and a teapot
increase the force (-0.01 ) if you want in line 81
MP_EntityAddImpulse(Mesh, 0, 0, -0.01 , -1.5,0, 0)
i'm the decorator, Michael is the Author
increase the force (-0.01 ) if you want in line 81
MP_EntityAddImpulse(Mesh, 0, 0, -0.01 , -1.5,0, 0)
i'm the decorator, Michael is the Author

Code: Select all
;// Project Title: MP 3D Engine Beispielprogramme
;// Dateiname: MP_GearsTest.pb
;// Erstellt am: 30.8.2013
;// Update am :
;// Author: Michael Paulwitz
;//
;// Info:
;// Gear Test
;// Zahnrad Test
;//
;//
;////////////////////////////////////////////////////////////////
MP_Graphics3D (640,480,0,1)
SetWindowTitle(0, "MP3D Physik Gear Demo")
camera = MP_CreateCamera() ; Kamera erstellen
MP_PositionCamera(camera, 0, 5, -5 )
MP_CameraLookAt(camera,0,0,0)
light= MP_CreateLight(0) ; Es werde Licht
Mesh = MP_CreateRectangle (2,0.05,0.5)
Mesh2 = MP_CreateRectangle (2,0.05,0.5)
MP_RotateEntity(Mesh2 , 0 , 0, 60, 1) : MP_ChangeMeshCoord(Mesh2)
MP_AddMesh(Mesh2 , Mesh ) : MP_FreeEntity(Mesh2)
Mesh2 = MP_CreateRectangle (2,0.05,0.5)
MP_RotateEntity(Mesh2 , 0 , 0, 120, 1) : MP_ChangeMeshCoord(Mesh2)
MP_AddMesh(Mesh2 , Mesh ) : MP_FreeEntity(Mesh2)
Mesh2 = MP_CopyEntity(Mesh)
;Mesh2 = MP_CopyEntity(Mesh)
Mesh7 = MP_CreateRectangle (0.05,4,0.05)
MP_RotateEntity(Mesh7 , 90 , 0, 0, 1) : MP_ChangeMeshCoord(Mesh7)
MP_AddMesh(Mesh7 , Mesh2 ) :MP_FreeEntity(Mesh7)
teapot = MP_CreateTeapot()
MP_ResizeMesh(teapot,0.5,0.5,0.5)
MP_PositionEntity (teapot,0,0,-2)
MP_RotateEntity(teapot , -90 , 0, 0, 1) : MP_ChangeMeshCoord(teapot)
MP_AddMesh(teapot , Mesh2 ) :MP_FreeEntity(teapot)
MP_EntitySetNormals (Mesh)
MP_MaterialDiffuseColor (Mesh,255,255,128,50)
MP_MaterialSpecularColor (Mesh, 255, 255 ,255, 155,5)
MP_EntitySetNormals (Mesh2)
MP_MaterialDiffuseColor (Mesh2,255,255,128,50)
MP_MaterialSpecularColor (Mesh2, 255, 255 ,255, 155,5)
MP_PositionEntity (Mesh,-1.7,0,0)
MP_PositionEntity (Mesh2,0,0,0)
MP_RotateEntity(Mesh, 90, 0, 0 )
MP_RotateEntity(Mesh2, 90, 0, 0 )
MP_PhysicInit()
MP_EntityPhysicBody(Mesh , 5, 10)
MP_ConstraintCreateHinge (Mesh,0,1,0)
MP_EntityPhysicBody(Mesh2, 5, 10)
MP_ConstraintCreateHinge (Mesh2,0,1,0)
MP_AmbientSetLight (RGB(0,100,200))
; those cubes are just place signs
Mesh4 = MP_CreateRectangle(0.2,0.2,0.2)
MP_PositionEntity (Mesh4,0,1.5,0)
Mesh5 = MP_CreateRectangle(0.2,0.2,0.2)
MP_PositionEntity (Mesh5,-1,1.5,0)
Mesh6 = MP_CreateRectangle(0.2,0.2,0.2)
MP_PositionEntity (Mesh6,-2,1.5,0)
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
;MP_TurnEntity(Mesh, 0, 0, 1 )
;MP_EntityAddImpulse(Mesh, 0, -0.03, 0 , -2.0,0, 0)
MP_EntityAddImpulse(Mesh, 0, 0, -0.01 , -1.5,0, 0)
MP_PhysicUpdate()
MP_RenderWorld() ; Erstelle die Welt
MP_Flip () ; Stelle Sie dar
Wend
MP_PhysicEnd()
Last edited by applePi on Sat Oct 19, 2013 5:31 am, edited 1 time in total.
-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hello ApplePi,
you understand mp3d perfectly. Thanks for your good demos...
i think the best counterpart of "EnableHingeJointAngularMotor" is the command MP_EntitySetOmega(Entity, xOmega.f , yOmega.f ,zOmega.f)
You can exchange the
with
With cursor up and down you can speed up the gears
You find a description of omega in the
http://www.newtondynamics.com/wiki/inde ... ySetOmega
P.S. All newtondynamics 3.1 functions are includet, but i have not all as mp3d commands implemented. If you need or want some of the newtondynamics commands, tell it and i will make it...
Greetings Michael
you understand mp3d perfectly. Thanks for your good demos...
i think the best counterpart of "EnableHingeJointAngularMotor" is the command MP_EntitySetOmega(Entity, xOmega.f , yOmega.f ,zOmega.f)
You can exchange the
Code: Select all
MP_EntityAddImpulse(Mesh, 0, 0, -0.01 , -1.5,0, 0)
Code: Select all
If MP_KeyDown(#PB_Key_Up)
omega.f + 0.5
ElseIf MP_KeyDown(#PB_Key_Down)
omega.f - 0.5
EndIf
MP_EntitySetOmega(Mesh, 0 , omega ,0)
You find a description of omega in the
http://www.newtondynamics.com/wiki/inde ... ySetOmega
P.S. All newtondynamics 3.1 functions are includet, but i have not all as mp3d commands implemented. If you need or want some of the newtondynamics commands, tell it and i will make it...
Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
IMHO there is no need you to ask about to implement or not some features which are very interesting, I mean, ¿why do not you implement interesting features to perform a better and better product without asking users?mpz wrote:P.S. All newtondynamics 3.1 functions are includet, but i have not all as mp3d commands implemented. If you need or want some of the newtondynamics commands, tell it and i will make it...
Greetings Michael
By the way; can you make the function MP_ScrollSurface() faster? It seems too slow!
This tip shows it ("galaxy.png" is a 1680x1050 pixels image) in a modern pc with modern VGA:
Code: Select all
ExamineDesktops()
Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0),RY.w=DesktopHeight(0),s_bg.i
MP_Graphics3D(RX,RY,0,0):MP_VSync(1)
SetWindowTitle(0,"SpaceKnight")
Cam=MP_CreateCamera()
Light=MP_CreateLight(1)
Surface=MP_LoadSurface("galaxy.png")
MP_CameraLookAt(Cam,MP_EntityGetX(polygon),MP_EntityGetY(polygon),MP_EntityGetZ(polygon))
MP_SurfaceSetPosition(Surface,0,0,1)
MP_SurfaceSrcRect(Surface,0,0,1680,1050)
MP_SurfaceDestRect(Surface,0,0,RX,RY)
While MP_KeyUp(#PB_Key_Escape) And WindowEvent()<>#PB_Event_CloseWindow
MP_ScrollSurface(Surface,0,1)
MP_DrawText(10,10,"FPS = "+Str(MP_FPS()) + "; SurfaceHeigh = "+Str(MP_SurfaceGetHeight(Surface))+"; SurfaceWidth = "+Str(MP_SurfaceGetWidth(Surface)))
MP_RenderWorld()
MP_Flip():Delay(16)
Wend
Re: MP3D Engine Alpha 32
many thanks michael, yes the MP_EntitySetOmega function behaves like the motor function and it provides a stable speed for the gear. and even it works better for the many polygons gear i have posted before but i'm now searching for a more suitable gear model with low polygons count. certainly there will be more mechanical toys we can make from those new functions.
best regards
best regards
-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hi,
@Psychophanta i think you had made a mistake in your demofile.
If you use "MP_VSync(0)" and dont use "Delay(16)" i have over 1000fps and the picture is scrolling 1000 pixel in one second. i think not the procedure is slow, it is the delay...
@applePi,
i hope you find some better models and we can make a mechanical clock with physic function or a game to combinate entitys with physic functions...
Greetings Michael
@Psychophanta i think you had made a mistake in your demofile.
If you use "MP_VSync(0)" and dont use "Delay(16)" i have over 1000fps and the picture is scrolling 1000 pixel in one second. i think not the procedure is slow, it is the delay...
@applePi,
i hope you find some better models and we can make a mechanical clock with physic function or a game to combinate entitys with physic functions...
Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
Re: MP3D Engine Alpha 32
Hello, @MPZ. Is there a small sample demo which allows for 2D map scrolling & 2D frame animation from a sprite sheet?
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
The Delay(16) just forces the loop program to perform all the task in 0.3333 milliseconds or less.mpz wrote:Hi,
@Psychophanta i think you had made a mistake in your demofile.
If you use "MP_VSync(0)" and dont use "Delay(16)" i have over 1000fps and the picture is scrolling 1000 pixel in one second. i think not the procedure is slow, it is the delay...
My demofile demonstrates that the loop takes more than 0.3333 milliseconds per loop, and this is a lot of time.
A deeper view demonstrates that is just the MP_ScrollSurface() command which consumes too much time.
Thanks!
-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hi
@Mythros
in the MPDemos you find the "TileEngine" folder. There is a tile editor and and easy "Dungeon Crawler" program with "2D map scrolling & 2D frame animation" i hope this helps...
@Psychophanta,
to copy a 2 Gbyte grafik file into the backbuffer of dx 9 you need time. i have no idea how to speed it up. But how man fps do you have exactly without delay? I have 1100, that means you must calculate 1 second / 1100 fps = 90 micro second and not 333 micro second for one pixel scrolling. The delay command is very inaccurate and you cant use it for calculation.
Have you onother programm to compare? Have you test the purebasic image funtions or a other dx9 funtions? Perhaps you have another demo program then i can check it out an make the procedure faster....
Greetings Michael
@Mythros
in the MPDemos you find the "TileEngine" folder. There is a tile editor and and easy "Dungeon Crawler" program with "2D map scrolling & 2D frame animation" i hope this helps...
@Psychophanta,
to copy a 2 Gbyte grafik file into the backbuffer of dx 9 you need time. i have no idea how to speed it up. But how man fps do you have exactly without delay? I have 1100, that means you must calculate 1 second / 1100 fps = 90 micro second and not 333 micro second for one pixel scrolling. The delay command is very inaccurate and you cant use it for calculation.
Have you onother programm to compare? Have you test the purebasic image funtions or a other dx9 funtions? Perhaps you have another demo program then i can check it out an make the procedure faster....
Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
Yes, i have this one that i copied from this PB forum thread:mpz wrote:Have you onother programm to compare?
Code: Select all
ExamineDesktops()
Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0),RY.w=DesktopHeight(0),s_bg.i
Procedure DrawScrollTile()
Static i.w,j.w,dy.w
For i=0 To RX Step 64
For j=0 To RY+64 Step 64
MP_DrawSprite(s_bg,i,j-dy)
Next
Next
dy+1
If dy>63
dy=0
EndIf
EndProcedure
MP_Graphics3D(RX,RY,bitplanes,0)
; MP_Graphics3DWindow(0,0,800,600,"",$CA1001)
CreateImage(0,64,64)
StartDrawing(ImageOutput(0))
Box(0,0,32,32,#Red)
Box(32,32,32,32,#Blue)
StopDrawing()
s_bg=MP_SpriteFromTexture(MP_ImageToTexture(0))
While MP_KeyUp(#PB_Key_Escape)
DrawScrollTile()
MP_DrawText(10,10,"FPS = "+Str(MP_FPS()))
MP_RenderWorld()
MP_Flip():Delay(16)
Wend
-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hi Psychophanta,
i have the same speed (1100 fps ) with a galaxy image from 1400x1040. Please use your "galaxy.png" image file and tell me the fps on your pc:
Your compare code has "only" 880 fps. How many fps on your pc please?
I'm really looking forward to the results of the two programs on your pc
best regards
Michael
i have the same speed (1100 fps ) with a galaxy image from 1400x1040. Please use your "galaxy.png" image file and tell me the fps on your pc:
Code: Select all
ExamineDesktops()
Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0),RY.w=DesktopHeight(0),s_bg.i
MP_Graphics3D(RX,RY,0,0):MP_VSync(0)
SetWindowTitle(0,"SpaceKnight")
Cam=MP_CreateCamera()
Light=MP_CreateLight(1)
Texture=MP_CatchTexture(?Logo,?Logoend-?Logo)
Surface=MP_TextureToSurface(Texture)
MP_CameraLookAt(Cam,MP_EntityGetX(polygon),MP_EntityGetY(polygon),MP_EntityGetZ(polygon))
MP_SurfaceSetPosition(Surface,0,0,1)
MP_SurfaceSrcRect(Surface,0,0,1680,1050)
MP_SurfaceDestRect(Surface,0,0,RX,RY)
While MP_KeyUp(#PB_Key_Escape) And WindowEvent()<>#PB_Event_CloseWindow
MP_ScrollSurface(Surface,1,0)
MP_DrawText(10,10,"FPS = "+Str(MP_FPS()) + "; SurfaceHeigh = "+Str(MP_SurfaceGetHeight(Surface))+"; SurfaceWidth = "+Str(MP_SurfaceGetWidth(Surface)))
MP_RenderWorld()
MP_Flip();:Delay(16)
Wend
DataSection
Logo:
IncludeBinary "Galaxy.png"
; IncludeBinary "SpiralGalaxyNCG6118-2004.png"
logoend:
EndDataSection
Code: Select all
ExamineDesktops()
Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0),RY.w=DesktopHeight(0),s_bg.i
Procedure DrawScrollTile()
Static i.w,j.w,dy.w
For i=0 To RX Step 64
For j=0 To RY+64 Step 64
MP_DrawSprite(s_bg,i,j-dy)
Next
Next
dy+1
If dy>63
dy=0
EndIf
EndProcedure
MP_Graphics3D(RX,RY,bitplanes,0)
; MP_Graphics3DWindow(0,0,800,600,"",$CA1001)
MP_VSync(0)
CreateImage(0,64,64)
StartDrawing(ImageOutput(0))
Box(0,0,32,32,#Red)
Box(32,32,32,32,#Blue)
StopDrawing()
s_bg=MP_SpriteFromTexture(MP_ImageToTexture(0))
While MP_KeyUp(#PB_Key_Escape)
DrawScrollTile()
MP_DrawText(10,10,"FPS = "+Str(MP_FPS()))
MP_RenderWorld()
MP_Flip();:Delay(16)
Wend
best regards
Michael
Working on - MP3D Library - PB 5.73 version ready for download
Re: MP3D Engine Alpha 32
Hi Michael
the results for the picture http://upload.wikimedia.org/wikipedia/e ... 8-2004.PNG 1.8 MByte
example 1
fps 248
example 2 (the Scroll Tile):
fps about 600
============================================
for the picture
http://haxt.googlecode.com/files/The%20Galaxy.png
3000 X 3000 24 BPP, 8.6 Mega Byte
example 1:
52 fps
===============================
Geforce GT 520 , old desktop pentium D 3GHZ
===============================
i see all the pictures slides smoothly
the results for the picture http://upload.wikimedia.org/wikipedia/e ... 8-2004.PNG 1.8 MByte
example 1
fps 248
example 2 (the Scroll Tile):
fps about 600
============================================
for the picture
http://haxt.googlecode.com/files/The%20Galaxy.png
3000 X 3000 24 BPP, 8.6 Mega Byte
example 1:
52 fps
===============================
Geforce GT 520 , old desktop pentium D 3GHZ
===============================
i see all the pictures slides smoothly
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
Without debuger and just with copy&paste your 'galaxy.png' tip i get: FPS = 146mpz wrote:Hi Psychophanta,
i have the same speed (1100 fps ) with a galaxy image from 1400x1040. Please use your "galaxy.png" image file and tell me the fps on your pc:
Your compare code has "only" 880 fps. How many fps on your pc please?Code: Select all
ExamineDesktops() Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0),RY.w=DesktopHeight(0),s_bg.i MP_Graphics3D(RX,RY,0,0):MP_VSync(0) SetWindowTitle(0,"SpaceKnight") Cam=MP_CreateCamera() Light=MP_CreateLight(1) Texture=MP_CatchTexture(?Logo,?Logoend-?Logo) Surface=MP_TextureToSurface(Texture) MP_CameraLookAt(Cam,MP_EntityGetX(polygon),MP_EntityGetY(polygon),MP_EntityGetZ(polygon)) MP_SurfaceSetPosition(Surface,0,0,1) MP_SurfaceSrcRect(Surface,0,0,1680,1050) MP_SurfaceDestRect(Surface,0,0,RX,RY) While MP_KeyUp(#PB_Key_Escape) And WindowEvent()<>#PB_Event_CloseWindow MP_ScrollSurface(Surface,1,0) MP_DrawText(10,10,"FPS = "+Str(MP_FPS()) + "; SurfaceHeigh = "+Str(MP_SurfaceGetHeight(Surface))+"; SurfaceWidth = "+Str(MP_SurfaceGetWidth(Surface))) MP_RenderWorld() MP_Flip();:Delay(16) Wend DataSection Logo: IncludeBinary "Galaxy.png" ; IncludeBinary "SpiralGalaxyNCG6118-2004.png" logoend: EndDataSection
I'm really looking forward to the results of the two programs on your pcCode: Select all
ExamineDesktops() Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0),RY.w=DesktopHeight(0),s_bg.i Procedure DrawScrollTile() Static i.w,j.w,dy.w For i=0 To RX Step 64 For j=0 To RY+64 Step 64 MP_DrawSprite(s_bg,i,j-dy) Next Next dy+1 If dy>63 dy=0 EndIf EndProcedure MP_Graphics3D(RX,RY,bitplanes,0) ; MP_Graphics3DWindow(0,0,800,600,"",$CA1001) MP_VSync(0) CreateImage(0,64,64) StartDrawing(ImageOutput(0)) Box(0,0,32,32,#Red) Box(32,32,32,32,#Blue) StopDrawing() s_bg=MP_SpriteFromTexture(MP_ImageToTexture(0)) While MP_KeyUp(#PB_Key_Escape) DrawScrollTile() MP_DrawText(10,10,"FPS = "+Str(MP_FPS())) MP_RenderWorld() MP_Flip();:Delay(16) Wend
best regards
Michael
With the other example i get: FPS = 252
Why do you get more FPS in the 'galaxy.png' example than in the other?


Can you test it in other machine of year 2006 to 2009 ?