It is currently Tue May 21, 2013 6:04 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 374 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 25  Next
Author Message
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 11:34 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1334
Location: Pas-de-Calais, France
Some remarks...

Is it possible to use the MP_MeshSetData() function with only #PB_Mesh_Vertex, and in a second step with #PB_Mesh_Normal | #PB_Mesh_Color | #PB_Mesh_UVCoordinate, or only the first time must I set all #PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_Color | #PB_Mesh_UVCoordinate ?

I had some big crashes (complete hang with reboot!!!) with some tests.

Translation : pitch, yaw, roll : y-axis, x-axis, z-axis ; rectangle, not retangle ; Effect, not Effekt (almost no "k" in english)

Loot a the following code. I have sort of a pause every second. After one minute, wave effect is suspended. Maybe the sinus function, but strange, isn't it?
Code:
;////////////////////////////////////////////////////////////////
;//
;// Project Title: MP 3D Test
;// Created On: 2.12.2010
;// Author: djes
;// OS:Windows
;//
;////////////////////////////////////////////////////////////////

#subdivisions = 64

MP_Graphics3D (640,480,0,3) ; Erstelle ein WindowsFenster #Window = 0
SetWindowTitle(0, "3D Darstellung eines Mesh Objektes")
camera=MP_CreateCamera() ; Kamera erstellen
light=MP_CreateLight(1) ; Es werde Licht

grid = MP_CreatePlane(#subdivisions, #subdivisions)

If CreateImage(0, 1024, 1024)
   Font = LoadFont(#PB_Any, "Arial"  , 138*4)
   StartDrawing(ImageOutput(0))
   Box(0, 0, 512, 512,RGB(255,0,0))
   Box(512, 0, 512, 512,RGB(0,255,0))
   Box(0, 512, 512, 512,RGB(0,0,255))
   Box(512, 512, 512, 512,RGB(255,255,0))
   DrawingFont(FontID(Font))
   DrawingMode(#PB_2DDrawing_Transparent)
   DrawText(73*4,35*4,"5",RGB(0,0,0))
   StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
EndIf
;
Textur = MP_ImageToTexture(0) ; Create Texture from image
MP_EntitySetTexture (grid,Textur)
MP_ScaleEntity (grid, 0.1, 0.1, 0.1)
MP_TurnEntity (grid, 0, 30, 0) ; Ein bischen drehen

i.f = 0
x.f=0 : y.f=0 : z.f+6

While Not MP_KeyDown(#PB_Key_Escape) And Not MP_WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
 
 If MP_KeyDown(#PB_Key_Left)=1 : x=x-1 : EndIf ;links Debug #PB_Key_Left
 If MP_KeyDown(#PB_Key_Right)=1 : x=x+1 : EndIf ;rechts #PB_Key_Right
 If MP_KeyDown(#PB_Key_Down)=1 : y=y-1 : EndIf ;Runter #PB_Key_Down
 If MP_KeyDown(#PB_Key_Up)=1 : y=y+1 : EndIf ;rauf #PB_Key_Up
 If MP_KeyDown(#PB_Key_Z)=1  : z=z+0.1 : EndIf ;y Vertauscht bei y-z bei deutscher tastatur
 If MP_KeyDown(#PB_Key_Y)=1  : z=z+0.1 : EndIf ;y Vertauscht bei y-z bei deutscher tastatur
 If MP_KeyDown(#PB_Key_A)=1  : z=z-0.1 : EndIf ;a #PB_Key_A
 
 MP_PositionEntity (grid, x, y, z) ; Position des Würfel
 MP_TurnEntity (grid, 1, 0, 0) ; Ein bischen drehen
 MP_RenderWorld() ; Erstelle die Welt
 MP_Flip () ; Stelle Sie dar
     
;****************
; Vertices deform
 
For gz = 0 To #subdivisions ;min 1
 
  For gx = 0 To #subdivisions ;min 1
   
     MP_VertexSetz(grid, (gz * (#subdivisions + 1)) + gx, Sin(i + gx / 2 + gz / 2))
     i+0.0001
 
  Next gx
 
Next gz
   

Wend
 
End
 

_________________
The Shooting Crew ~> http://www.shootingcrew.com/
Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 3:23 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
Hi djes,

nice example and thanks for working with mp3d. The problem must be in the sin function. I have checked my code and found no error. If you reset the i variable, the function works fine again, but i dont know why ;)

Code:
For gz = 0 To #subdivisions ;min 1
 
  For gx = 0 To #subdivisions ;min 1
   
     MP_VertexSetz(grid, (gz * (#subdivisions + 1)) + gx, Sin(i + gx / 2 + gz / 2))
     i+0.0001
    If MP_KeyDown(#PB_Key_R) ; reset i
        i = 0
   EndIf
 
  Next gx
 
Next gz



The command MP_MeshSetData() was only for some compatibility of PB codes and and has not a good command input error detection. You must set the #PB_Mesh_Vertex with #PB_Mesh_Normal etc etc. in one step. Do you need this function with step by step ?!?

Translation : pitch, yaw, roll : y-axis, x-axis, z-axis ; rectangle, not retangle ; Effect, not Effekt (almost no "k" in english)
Thanks, i need help in this case...


best regards Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 3:41 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1334
Location: Pas-de-Calais, France
Thanx for reply! Do you have an idea for the frame drop every second?

_________________
The Shooting Crew ~> http://www.shootingcrew.com/
Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 5:16 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
Hi Djes,

what exactly does it mean "frame drope every second"? If you move the Mesh away does the "frame drope" happens again?!?

Greetings Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 5:20 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1334
Location: Pas-de-Calais, France
I have a small lag every second, happening whatever I do. I'll try on another PC.

_________________
The Shooting Crew ~> http://www.shootingcrew.com/
Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 5:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
Hi Dijes,

icesoft use the mp3d engine to make games. Have you the same problem with his compiled program too?
viewtopic.php?f=16&t=44369&start=0

i have compiled your "flag program". Does it have the same problem on your pc?
http://www.file-upload.net/download-301 ... g.exe.html

Greetings Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Thu Dec 02, 2010 7:17 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1334
Location: Pas-de-Calais, France
No the problem disappeared, the video card is faulty (intel!). For the sin bug, it's a float one, see this : viewtopic.php?p=340264#p340264

_________________
The Shooting Crew ~> http://www.shootingcrew.com/
Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Tue Jan 18, 2011 6:33 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Jan 02, 2007 8:16 pm
Posts: 4328
Location: Cypress TX
having some problems doing what I want. I havea wheel and I want to slow the spin down gradually (like decay) but using the friction functions is not working right...

Code:
; Slots Demo 001
;////////////////////////////////////////////////////////////////

; ########   SETUP PLACE HOLDERS FOR EULER ANGLES
Dim rol.l(9) ; ROLL
Global stillspinning
Global turns
Global wheelnumber

; ########## These are the YAW numbers for EACH of the numbers
; based on how the wrapping worked un UU3D...
; don't feel like messing with it so it goes this way...

rol(0)=-255 ; 0
rol(1)=-294 ; 1
rol(2)=-331 ; 2
rol(3)=0 ; 3
rol(4)=-40 ; 4
rol(5)=-73 ; 5
rol(6)=-109 ; 6
rol(7)=-149 ; 7
rol(8)=-184; 8
rol(9)=-222 ; 9

; ########  Randomly position the wheel
wheelend=Random(9)
whee = wheelend
wheel = wheelend * 2
wheelend = wheelend - wheel ; to get negative position number as we want this  direction rotation

Decay.f= 0.01
;////////////////////////////////////////////////////////////////

MP_Graphics3D (800,600,0,1) ; Erstelle ein WindowsFenster #Window = 0
SetWindowTitle(0, "SLOT DEMO 0.1a")

camera=MP_CreateCamera()

light=MP_CreateLight(2)

; ************************************
;- LOAD ALL MESH

Mesh1 = MP_LoadMesh("wheel2.b3d")

;- MESH START POSITIONS

MP_PositionEntity (Mesh1, 0,0,72)

;- MAIN LOOP
InitKeyboard()

HaveWheelsStopped=#False

speed = 1

MP_EntitySetPhysics(Mesh1, 0 , 0 ,0.25)

While Not MP_KeyDown(#PB_Key_Escape) And Not MP_WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
 
  If HaveWheelsStopped=#False
    speed = speed + (20 - decay)
    If speed > 360
      speed = 0
    EndIf
    ;MP_EntitySetPhysics(Mesh1, 0 , 0 ,Decay) ; does not seem to slow wheel down
    MP_RotateEntity(Mesh1,0,speed,0) ; rotate the wheel
    Decay = decay + 0.1
  EndIf
 
  MP_DrawText (1,1,"END :"+ Str(whee))
  MP_DrawText (1,22,"YAW :"+ Str(MP_EntityGetYaw(Mesh1)))
  MP_DrawText (1,44,"Speed:"+ Str(speed))
  MP_DrawText (1,66,"Friction:"+ StrF(Decay,2))
  MP_UpdateWorld()
  MP_RenderWorld()
  MP_Flip ()
 
Wend

End
;- END OF PROGRAM


You can get the model and texture HERE (model and texture must be in same folder!)
http://www.bluemesapc.com/Downloads/wheel.zip
I just want to set up a random speed and then slow the wheel down to 0 while being able to tell the location landed on.

_________________
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Tue Jan 18, 2011 8:49 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1298
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
is this ok for you?
LMB starts the wheel.
Code:
; Slots Demo 001
;////////////////////////////////////////////////////////////////

; ########   SETUP PLACE HOLDERS FOR EULER ANGLES
Dim rol.l(9) ; ROLL
Global stillspinning
Global turns
Global wheelnumber


MP_Graphics3D (800,600,0,1) ; Erstelle ein WindowsFenster #Window = 0
SetWindowTitle(0, "SLOT DEMO 0.1a")

camera=MP_CreateCamera()

light=MP_CreateLight(2)

; ************************************
;- LOAD ALL MESH

Mesh1 = MP_LoadMesh("wheel2.b3d")

;- MESH START POSITIONS

MP_PositionEntity (Mesh1, 0,0,72)


HaveWheelsStopped=#False

speed = 1

;MP_EntitySetPhysics(Mesh1, 0 , 0 ,0.25)
rot.F = 0
deltA.f = 0
HaveWheelsStopped = #True
While Not MP_KeyDown(#PB_Key_Escape) And Not MP_WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
  If MP_MouseButtonDown(0)
    HaveWheelsStopped = #False
    deltA.f = 50
  EndIf

  If HaveWheelsStopped=#False
    rot = delta
    delta - delta/20
    If delta <= 0
      HaveWheelsStopped = #True
    EndIf
  Else
    rot = 0
  EndIf
 
  MP_TurnEntity(Mesh1, 0, rot, 0)

  MP_DrawText (1,1,"END :"+ Str(whee))
  MP_DrawText (1,22,"YAW :"+ Str(MP_EntityGetYaw(Mesh1)))
  MP_DrawText (1,44,"Speed:"+ Str(speed))
  MP_DrawText (1,66,"Friction:"+ StrF(rot,2))
  ;MP_UpdateWorld()
  MP_RenderWorld()
  MP_Flip ()
 
Wend

End
;- END OF PROGRAM

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 27
PostPosted: Wed Jan 19, 2011 1:47 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
Thanks IceSoft,

you found a good solution. The Physik engine is not very good and can't handle weels for now. I will update this in the next time. Now i am working on some nice feature like x64 lib, FX lib and postprocessing...

Greetings Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 28
PostPosted: Thu Jan 27, 2011 12:29 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
MP3D Engine Alpha 28

is out

* The most important innovation is the integration of many function of the FXLib by Epyx in mp3D (Thanks to the implementation of Epyx).
* post processing with shader.

Best regards Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 28
PostPosted: Sat Feb 19, 2011 8:54 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1334
Location: Pas-de-Calais, France
Wow, great :)

_________________
The Shooting Crew ~> http://www.shootingcrew.com/
Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 28
PostPosted: Thu Feb 24, 2011 1:11 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
Hi Djes,

thanks, in the next version will come some "little" shader like the 5 pass planet shader. This shader has light and bumpmap, nightmap, moving waves and moving clouds
http://www.file-upload.net/download-323 ... r.exe.html

greatings michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 28
PostPosted: Thu Feb 24, 2011 9:58 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1334
Location: Pas-de-Calais, France
mpz wrote:
Hi Djes,

thanks, in the next version will come some "little" shader like the 5 pass planet shader. This shader has light and bumpmap, nightmap, moving waves and moving clouds
http://www.file-upload.net/download-323 ... r.exe.html

greatings michael

Thanks for sharing, great FX! :)

_________________
The Shooting Crew ~> http://www.shootingcrew.com/
Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 28
PostPosted: Sat Feb 26, 2011 12:45 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 212
Location: Germany, Berlin > member German forum
Hi,

i am translating the greate XNA Shader Programming Demos of digitalerr0r to MP3D. I think it is one of the best tutorials in the net fro shader. mp3d has all commands to make the transfer easly. I know it is not the "BIG BIG OGRE" but i think it is fine ;)

XNA Shader Programming – Tutorial 13, Alpha mapping
http://digitalerr0r.wordpress.com/2009/ ... a-mapping/

MP3D Demotranslation:
http://www.file-upload.net/download-324 ... r.exe.html

Greeting Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 374 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 25  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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