Re: MP3D Alpha 22 zum testen
Verfasst: 09.03.2010 01:21
Hallo Leute,
die 22 ist raus (findet man hier am Anfang) und das Forum temporär down. Der Anbieter hat ein PHP Update gemacht und jetzt ist Fehlersuche angesagt. Also habt etwas Geduld...
Neuerungen der 22, ScrollSurface um den Hintergrund zu scrollen. Man kann es sicher so machen
1) http://www.purebasic.fr/english/viewtop ... 16&t=40637
oder aber so machen
2) http://em.q-soft.ch/files/get/V028GUzL1A/scrollen2.exe
Und Neuerungen die Primitves
http://em.q-soft.ch/files/get/nRSMwrkEF5/primitives.exe
Hier noch die beiden Quellcodes:
ScrollSurface:
Primitives:
Gruß Michael
die 22 ist raus (findet man hier am Anfang) und das Forum temporär down. Der Anbieter hat ein PHP Update gemacht und jetzt ist Fehlersuche angesagt. Also habt etwas Geduld...
Neuerungen der 22, ScrollSurface um den Hintergrund zu scrollen. Man kann es sicher so machen
1) http://www.purebasic.fr/english/viewtop ... 16&t=40637
oder aber so machen
2) http://em.q-soft.ch/files/get/V028GUzL1A/scrollen2.exe
Und Neuerungen die Primitves
http://em.q-soft.ch/files/get/nRSMwrkEF5/primitives.exe
Hier noch die beiden Quellcodes:
ScrollSurface:
Code: Alles auswählen
MP_Graphics3D (640,480,0,3) ; Create Windows, #Window = 0
SetWindowTitle(0, "Alpha Cube with scrolling Background")
camera=MP_CreateCamera() ; Create Camera
light=MP_CreateLight(1) ; Create light
Mesh=MP_CreateCube() ; Cretae Cube
Texture = MP_CatchTexture(?Pic, ?Picend-?Pic) ; Make textur from Scroll Image (2280 X 450 Pixel)
Surface = MP_TextureToSurface(Texture) ; Make a Surface from Textur
If CreateImage(0, 255, 255) ; Make image -> Original Purebasic procedure
Height=255
x = 128
y = 128
StartDrawing(ImageOutput(0))
For Radius = Height/2 To 10 Step -10
Circle(x, y, radius ,RGB(Random(255),Random(255),Random(255)))
Next
StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
EndIf
Texture2 = MP_ImageToTexture(0) ; Make Textur from Purebasic Image
MP_EntitySetTexture(Mesh, Texture2) ; Put Texture to Cube
MP_TexturSetAlpha (Texture2,1) ; Make Alpha Cube
;-
MP_SurfaceSetPosition(Surface,0,0,1) ; Start Surface on Position 0,0
MP_SurfaceSrcRect(Surface,0, 0, 256, 256) ; get 256*256 Pixel from Scroll Image
MP_SurfaceDestRect(Surface,0, 0, 640, 480) ; Strech it on the 640*480 Screen
MP_PositionEntity (Mesh,0,0,5) ; Position of the Cube
While Not MP_KeyDown(#PB_Key_Escape) And Not MP_WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
yy.f + 0.01
MP_ScrollSurface(Surface, Sin(yy) * 0.9, 1 ) ; Scroll the Surface Image
MP_DrawText (10,10,Str(MP_FPS())) ; Have i the normal FPS?
MP_TurnEntity (Mesh,0.1,0.1,0.1) ; Turn the Cube
MP_RenderWorld() ; Erstelle die Welt
MP_Flip () ; Stelle Sie dar
Wend
DataSection
Pic: IncludeBinary "Regensburg_Uferpanorama_08_2006_.jpg"
PicEnd:
EndDataSection
Code: Alles auswählen
MP_Graphics3D (640,480,0,3) ; Erstelle ein WindowsFenster mit 3D Funktion #Window = 0
SetWindowTitle(0, "Darstellung von Primitives") ; Setzt einen Fensternamen
camera=MP_CreateCamera() ; Kamera erstellen
Entity = MP_CreatePrimitives (6, 2) ; 6 Vertexe und LINELIST (einzelne Linien)
MP_EntitySetZ (Entity, 8)
MP_SetPrimitives(Entity, 0, 0, 2, 0, $FFFFFFFF)
MP_SetPrimitives(Entity, 1, 0, -2, 0, $FF0000FF)
MP_SetPrimitives(Entity, 2, -2, 0, 0, $FF00FF00)
MP_SetPrimitives(Entity, 3, 2, 0, 0, $FF00FFFF)
MP_SetPrimitives(Entity, 4, 0, 0, 2, $FFFF0000)
MP_SetPrimitives(Entity, 5, 0, 0, -2, $FFFF00FF)
While Not MP_KeyDown(#PB_Key_Escape) And Not MP_WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
MP_TurnEntity (Entity,0.1,0.1,0.1) ; dreh den Würfel
MP_RenderWorld() ; Erstelle die Welt
MP_Flip () ; Stelle Sie dar
Wend