MP3D Engine Alpha 33

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

@mpz,
I see, however, maybe interesting to do an addendum for the help file for those who want to do things in that risky way, but gaining a little bit faster programs. 8)

EDIT:
Just downloaded:
http://www.morty-productions.de/gamedev ... hp?tid=145
I have 2 started projects with DM3D, but i will change to MP3D after perform some simple speed tests. I could easely migrate the code of those 2 projects to MP3D, but i don't know if it is a worth.

About Pro or not Pro product:
I must say MP3D is a professional product, and DM3D too, because my 2 projects will appear in a video doc at Discovery Channel, and also in National Geographic. And of course i gain money with it. :)
In the future there is expected more, and 97% probability i change from DM3D to your engine.

BTW: I love all the Epyx stuff, so please never remove it form the lib.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Dear Psychophanta,

is an example of the video doc from Discovery Channel and National Geographic one youtube ore somewhere else? These are very good tv channels and you projects looks very interessting...

Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

mpz wrote:Dear Psychophanta,

is an example of the video doc from Discovery Channel and National Geographic one youtube ore somewhere else? These are very good tv channels and you projects looks very interessting...

Greetings Michael
I am now working on it, i will send you all the link to see it when it is presented to those TV channels and emitted.
It is a long way, but not so long; i guess before the end of the 2013, you will be notified of those links to see the video sequence.

Now i just finished the 1st stage of a project, it is an order to divulgation of a very new mechanics theory (Theory of Dynamic Interactions): it is a video in spanish for:
http://www.advanceddynamics.net/
and
http://www.dinamicafundacion.com/
The video includes explanation in 3D of the theory, made with DM3D.
The 2nd and last stage of this project is just to convert the spanish audio of this video to english, also with my own voice and other one.
Next month or so, i will write here the link to the english version in youtube :)

Next is to publish an article here:
http://www.scirp.org/journal/wjm/
with the english video included.

There is a next project:
2 videos for scientific TV channels (at the moment Discovery Channel and National Geographic) are:
- Boomerang, explaining exactly how it works (the behaviour of the trajectory of a boomerang is not due to air fluid effects, but air just gives to the system a secondary torque not colineal with the main angular momentum, and the explanation of it is in the Theory i refer before).
- Peg-Top dancing (not the rotation around itself, but about the desviation of the trajectory when it is translated while it rotates over itself).

If wanted, look at http://www.advanceddynamics.net/index.php?lang=en to know about.

BY THE WAY: If there are one of you who want to talk ine english some paragraphs for the voice-over for the english version of the video, please send me a pm . Not hurry for it. He or she will just appear at the credits of the video as collaboration staff.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: MP3D Engine Alpha 31

Post by AndyLy »

Hardly found. Looked at the whole site (or such was the plan?).
You mean this video?
http://www.youtube.com/watch?v=vSUkd4slHGQ&feature
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

AndyLy wrote:Hardly found. Looked at the whole site (or such was the plan?).
You mean this video?
http://www.youtube.com/watch?v=vSUkd4slHGQ&feature
Well. Yes, you found.
That is the man, Gabriel Barcelo, my manager and supervisor.
That video was made years ago, and i complained his experiment was not inertial movs: the rotation over itself and the translation of the "submarine" was NOT inertial. I made an instrumen to demostrate his theory much better on Earth. The video i talked about is made with my experiment instrument i designed. The version in spanish is here (low quality (for upload), but enougth):
http://depositfiles.com/files/mugbc1a5w
Is is not the final version but i changed some small details but it is almost the same.
The voice-over of that video is the voice i need to be in english.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

I decided to migrate from DM3D to MP3D.
Just left only 3 points to solve:

1) In DM3D there is:
DM_EntityPickMode(*entity,1) to allow the entity to be picked capable or not to be.
How to do with MP3D?

2) I need to make visible or invisible entities. I know how to do it with MP3D, but sometimes i need to hide an object but make it pick capable. I do this using Brushes with DM3D:
To show it:

Code: Select all

*brush=DM_GetBrush(*entity)
DM_BrushAlpha(*brush,255,255,255)
To hide it:

Code: Select all

*brush=DM_GetBrush(*entity)
DM_BrushAlpha(*brush,0,0,0)
I have not found brushes in MP3D, how to do this? with materials? using shaders?
Brushes are also useful to put a texture to a mesh, allowing some tricks for coloring for example.

3) I can get the distance form camera to the picked point at the picked entity, but how to get the world coodinates (x,y,z) of this point?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Hello,

her some answers

1) In DM3D there is: DM_EntityPickMode
Picking for all Mesh are includet for now for all

2) I need to make visible or invisible entities.
in MP3D have you MP_HideEntity( Meshs, 1). You can pick invisible entities too

brushes, no in mp3d not included, in normal case you use material for colors or in the mp3d_32 you can add some textures (added two textures) on a mesh

3) distance form camera to the picked point at the picked entity
in the demos you find the picking demo folder. Here is the MP_Line Picking Demo.pb. You can use it to get the x,y,z picking position

Greetings
Working on - MP3D Library - PB 5.73 version ready for download
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: MP3D Engine Alpha 31

Post by applePi »

until Michael release his next version with infinite points list here is a way to convert a picture to Entity in 3D, it will calculate the necessary number of partitions for the picture every partition is 999 points if you want use this picture this picture ... but convert it first to BMP rename it as woman.bmp ,the best converter ever irfanview http://www.irfanview.com
you will get a rotating picture like this
Image
i wonder how to make the picture transparent, i have used MP_MeshSetAlpha (Entity(i),2) but it does not work.
copy the bmp picture to the same folder of the code

Code: Select all

Global xres=640, yres=480
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "shadow, press Z, X keys to shift picture")
;MP_Wireframe(1)
camera=MP_CreateCamera()

light=MP_CreateLight(2)
MP_LightSetColor (light, RGB(255,255,255))
MP_InitShadow()

texture2 = MP_CreateTextureColor(256, 256, MP_ARGB(0,255,255,0))
texture = MP_CreateTextureColor(256, 256, MP_ARGB(0,255,0,0))
sphere = MP_CreateSphere(30)
MP_EntitySetColor(sphere,RGB(0,255,0))
MP_EntitySetTexture(sphere, texture2)
MP_ScaleMesh(sphere,1,1,1)

plane = MP_CreatePlane(10, 10)
MP_EntitySetTexture(plane, texture)
MP_RotateEntity(plane, 0, 90, 90)

MP_PositionCamera(camera, 10, 5, 6)
MP_CameraLookAt(camera,0,0,0)

MP_PositionEntity(light, 0, 10, 20)
MP_EntityLookAt(light,0,0,0)
;==============================================================
; load image
Define image_id.i
image_id = LoadImage( #PB_Any, "woman.bmp" )
Dim image_pixel_data.b( ImageWidth(image_id), ImageHeight(image_id) )
ImagePartitions = Int(ImageWidth(image_id)*ImageHeight(image_id)/999)

Dim Entity(ImagePartitions)
For i=0 To ImagePartitions
Entity(i) = MP_CreatePrimitives (999, 1) 
Next i
Dim j(999)  


StartDrawing( ImageOutput( image_id ) )

For y = 0 To ImageHeight(image_id) - 1
  For x = 0 To ImageWidth(image_id) - 1
    rd=MP_Red(Point( x, y ))
    gr=MP_Green(Point( x, y ))
    bl=MP_Blue(Point( x, y ))
    pixColor = Point( x, y )
    i+1
    ImagePart = Int(i/999)
    If ImagePart > ImagePartitions
      Break 2
    EndIf
      MP_SetPrimitives(Entity(ImagePart), j(ImagePart),  x, y, 0,  MP_ARGB(0,rd,gr,bl))
      j(ImagePart) + 1  
      
    Next x
  Next y
  StopDrawing()
  
For i=0 To ImagePartitions  
  MP_ScaleEntity(Entity(i), 0.03, 0.03, 0.03)
  ;MP_MeshSetAlpha(Entity(i),3)
  ;MP_EntitySetTexture (Entity(i), Textur2) 
  ;MP_MeshSetAlpha (Entity(i),2)
  MP_PositionEntity(Entity(i), 0, 0, 0)
  MP_RotateEntity(Entity(i),90,180,0)
Next

;==============================================================

MP_PositionEntity(light, 0 , 10, 0)
MP_EntityLookAt(light,0,0,0)


xx.f=-5 :z.f=-4
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
  
  If MP_KeyDown(#PB_Key_Z) 
    xx.f + 0.1
    z.f + 0.1
  ElseIf MP_KeyDown(#PB_Key_X) 
    xx.f - 0.1
    z.f - 0.1
  EndIf 
  
  For i=0 To 20
    MP_PositionEntity(Entity(i), xx, 1, z)
    MP_TurnEntity(Entity(i),1,0,0) 
  Next 
  For i=21 To ImagePartitions
     MP_PositionEntity(Entity(i), xx, 1, z)
     MP_TurnEntity(Entity(i),1,0,0) 
  Next 
  MP_RenderWorld()
   
  MP_Flip ()

Wend
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: MP3D Engine Alpha 31

Post by AndyLy »

applePi
Well done of course, but better make terrain editor to work with changes in 3D and in real time. It would have been useful. :)

P.s. Michael, in my opinion has released a new update with infinite points.
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: MP3D Engine Alpha 31

Post by applePi »

thank you AndyLy, yes it is newer ,i have downloaded only the MP3D_Library, and now the points lists without limitation, and the complexity in the code are much less.
attached below the same previous code but replacing the many entities (about 50) with one wich have points numbers imagewidth X imageHeight.
i get the following picture if i have used the coordinates used by the previous example. may be Michael changed the way how the coordinates displayed we will wait the official release. the new feature make it possible to plot 3D curves the easy way with full color.
Image

Code: Select all

Global xres=640, yres=480
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "shadow, press Z, X keys to shift picture")
;MP_Wireframe(1)
camera=MP_CreateCamera()

light=MP_CreateLight(2)
MP_LightSetColor (light, RGB(255,255,255))
MP_InitShadow()

texture2 = MP_CreateTextureColor(256, 256, MP_ARGB(0,255,255,0))
texture = MP_CreateTextureColor(256, 256, MP_ARGB(0,255,0,0))
sphere = MP_CreateSphere(30)
MP_EntitySetColor(sphere,RGB(0,255,0))
MP_EntitySetTexture(sphere, texture2)
MP_ScaleMesh(sphere,1,1,1)

plane = MP_CreatePlane(10, 10)
MP_EntitySetTexture(plane, texture)
MP_RotateEntity(plane, 0, 90, 90)

MP_PositionCamera(camera, 10, 5, 6)
MP_CameraLookAt(camera,0,0,0)

MP_PositionEntity(light, 0, 10, 20)
MP_EntityLookAt(light,0,0,0)
;==============================================================
; load image
Define image_id.i
image_id = LoadImage( #PB_Any, "woman.bmp" )
Dim image_pixel_data.b( ImageWidth(image_id), ImageHeight(image_id) )
PointsNumer = Int(ImageWidth(image_id)*ImageHeight(image_id))

Dim j(PointsNumer)
Entity= MP_CreatePrimitives (PointsNumer, 1) 

StartDrawing( ImageOutput( image_id ) )

For y = 0 To ImageHeight(image_id) - 1
  For x = 0 To ImageWidth(image_id) - 1
    rd=MP_Red(Point( x, y ))
    gr=MP_Green(Point( x, y ))
    bl=MP_Blue(Point( x, y ))
    pixColor = Point( x, y )
    i+1
    MP_SetPrimitives(Entity, i,  x, y, 0,  MP_ARGB(0,rd,gr,bl))
            
    Next x
  Next y
  StopDrawing()
  MP_ScaleEntity(Entity, 0.03, 0.03, 0.03)
  ;MP_MeshSetAlpha(Entity(i),3)
  ;MP_MeshSetAlpha (Entity(i),2)
  MP_PositionEntity(Entity, 0, 0, 0)
  MP_RotateEntity(Entity,90,180,0)

;==============================================================

MP_PositionEntity(light, 0 , 10, 0)
MP_EntityLookAt(light,0,0,0)

xx.f=-5 :z.f=-4
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
  
  If MP_KeyDown(#PB_Key_Z) 
    xx.f + 0.1
    z.f + 0.1
  ElseIf MP_KeyDown(#PB_Key_X) 
    xx.f - 0.1
    z.f - 0.1
  EndIf 
  
    MP_PositionEntity(Entity, xx, 1, z)
    MP_TurnEntity(Entity,1,0,0) 
   
  MP_RenderWorld()
   
  MP_Flip ()

Wend
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

Hallo,
your lib looks very good, however i found some unstable issues i must deal with.

But apart of all it:
mpz wrote: in the demos you find the picking demo folder. Here is the MP_Line Picking Demo.pb. You can use it to get the x,y,z picking position
No mpz, as you can see, there is not obtained the x,y,z picking position, but the x,y,z of the geometrical centre of the picked object, wich is by far very different.

Apart, i found a bug: Primitives object (entity) is not able to be hidden.

Thanks
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: MP3D Engine Alpha 31

Post by AndyLy »

applePi I have not seen your code, but did you read this? :
Important changing! the Pitch and Yaw function is changed. Now it is like in other 3d languages: MP_EntityGetPitch(Entity), MP_EntityGetYaw (Entity),
MP_RotateEntity (Entity, pitch.f, yaw.f, roll.f) and MP_TurnEntity (Entity, pitch.f, yaw.f, roll.f)
Psychophanta
Apart, i found a bug
Only one? You have so much ahead of discoveries.
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

AndyLy wrote:applePi I have not seen your code, but did you read this? :
Important changing! the Pitch and Yaw function is changed. Now it is like in other 3d languages: MP_EntityGetPitch(Entity), MP_EntityGetYaw (Entity),
MP_RotateEntity (Entity, pitch.f, yaw.f, roll.f) and MP_TurnEntity (Entity, pitch.f, yaw.f, roll.f)
Psychophanta
Apart, i found a bug
Only one? You have so much ahead of discoveries.
eheh!
Damn! you are right!
I just discovered the same issues than in other alpha 3D engines. It get me angry :x
@mpz,
Please take this in account: in Direct3D ALWAYS:
World 'X' axis is defined by a horizontal vector respect the plane of the display monitor, and points from left to right.
World 'Y' axis is defined by a vertical vector respect the plane of the display monitor, and points from down to upwards.
World 'Z' axis is defined by a perpendicular vector respect the plane of the display monitor, and points from back to frontwards.
That is basicall!!! :!:
For example In this current lib (Alpha 32) Meshes like MP_CreateCube() MP_CreatePyramid() are in wrong initial rotation (and may be Cameras too).
There have to make:
MP_rotateEntity(Mesh,-180,0,-90)
in order the turns and rotations works a little bit more correct...

...

@mpz,
I see you alert your product is an ALPHA , but in you hands you have a good project to make a correct and decent product.
So tell us if you will fix the main issues more or less soon, because if you don't have in your mind to fix it all, and will abandon it (just like TMyke did stupidly with DM3D), there would be a big pity to me and must look for other decent engine.

Thanks a lot!
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: MP3D Engine Alpha 31

Post by IdeasVacuum »

I think TMyke has also abandoned N3XTD, or something bad has happened to him.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: MP3D Engine Alpha 31

Post by AndyLy »

Psychophanta
Do not be so strict with Michael. He does what he can and does it well. Bugs and flaws exist in all programs. Even in professional.
Maybe not tomorrow, not next year, but he will finish the engine to fine state. I believe in him.
'Happiness for everybody, free, and no one will go away unsatisfied!'
SMsF town: http://www.youtube.com/watch?v=g6RRKYf_Pd0
SMf locations module (Ogre). Game video: http://www.youtube.com/watch?v=ZlhBgPJhAxI
Post Reply