Procedure Move(*CurX, *CurY,Angle.f,Speed.f) Until Quit = #True Or Event = #PB_Event_CloseWindowĬode: Select all MP_Graphics3DWindow(0, 0, 1024, 768, "MP3D Physik Demo",0) If MP_KeyDown(#PB_Key_PageUp) scale up modelĮlseIf MP_KeyDown(#PB_Key_PageDown) scale down modelĮlseIf MP_KeyDown(#PB_Key_Pad2) down moveĮlseIf MP_KeyDown(#PB_Key_Q) forward moveĮlseIf MP_KeyDown(#PB_Key_A) inward moveĮlseIf MP_KeyHit(#PB_Key_W) display wire frame for the material MP_DrawText (1,15,"keyPad keys: up.")ĮlseIf MP_KeyDown(#PB_Key_Down) rotate rightĮlseIf MP_KeyDown(#PB_Key_Right) rotate upĮlseIf MP_KeyDown(#PB_Key_Left) rotate down Rotx0= rotx:roty0=roty:rotz0=rotz back up rotation status Rotx= rotx0:roty=roty0:rotz=rotz0 restore rotation status MP_PositionEntity (Mesh,0,0.1,3) Position des Meshs Texture = MP_LoadTexture("terrain_texture.jpg") connecting the first 2 vertices index with the last 2 vertices (twisted!!!) ![]() Txu = txu 1/(2*#PI/0.1) texture coordinates WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW ![]() Mesh = MP_CreateMesh() Erzeuge leeres Mesh MP_DrawText (1,1,"press W _wireFrame, D _ delete triangles")īuttonGadget(#BUTTON, 0, DesktopHeight(0)-60, 60, 30, "rotate/stop") SetWindowTitle(0, "PgUp PgD scale mesh.Arrows for rotation, space: stop/rotate, QA far/near, key_pad R/L/U/D") MP_Graphics3D (DesktopWidth(0),DesktopHeight(0),0,2) Erstelle ein WindowsFenster #Window = 0 PS: i forgot to say that to use the texture "terrain_texture.jpg" copy it from purebasic/Examples/3D/Data/Textures to the same folder of the code. press spacebar to toggle rotate/stop then it begins rotation from the last state it was when i have noticed in line 137 MP_ScaleEntity(Mesh,xs,ys,zs) that if xs, ys, zs go negative then the functions convert it to positive, this is why i have inserted the "If" condition to prevent this phenomena. this is like cutting a magnet in half there are alway 2 poles. Press W to go to wire mode, press D to delete triangles continuously, using MP_FreeTriangle(Mesh, 1) so we are always have index 1, thanks for Michael for this great feature. note the connection between the two end of the strip, because it is twisted each to the other and there is no up or down in mobius strip it makes a problem for me in texturing. and it goes through the whole circle ie 2*Pi. The width of the strip are from -0.5 to 0.5 through 2 vertices. The code are too short and basic, it is only the controlling code wich makes it bigger ,it is not necessary (but necessary !!). hp?tid=145 and replace the original sole file in C:\PureBasic\SubSystems\DX9\purelibraries\userlibraries Priority: after installing MP3D v31 you need MP3D v32 from. While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow Esc abfrage oder Windows Schliessen ![]() MP_PositionEntity (Mesh4,1.5,1.5,8) Position des Meshs MP_PositionEntity (Mesh3,1.5,-1.5,8) Position des Meshs MP_PositionEntity (Mesh2,-1.5,1.5,8) Position des Meshs MP_PositionEntity (Mesh1,-1.5,-1.5,8) Position des Meshs Erstelle 2 x drei Eckpunkte mit UV Koordinaten Textur wird einfach gemacht Mesh1 = MP_CreateMesh() Erzeuge leeres Mesh Texture = MP_ImageToTexture(0) Create Texture from image StopDrawing() This is absolutely needed when the drawing operations are finished !!! Never forget it ! If CreateImage(0,32, 32) Erzeuge 6 unterschiedliche Texturseiten SetWindowTitle(0, "Vertex und Triangle Demo")Ĭamera=MP_CreateCamera() Kamera erstellen MP_Graphics3D (640,480,0,1) Erstelle ein WindowsFenster #Window = 0 ![]() Project Title: MP 3D Engine Beispielprogramme
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |