Page 54 of 71

Re: MP3D Engine Alpha 32

Posted: Tue Nov 25, 2014 3:12 pm
by Psychophanta
mpz wrote: i am working on a new lib and the new lib has for example

MP_CreateCubeTexture(Size(,Miplevel)) -> Create empty six side cube texture
MP_CopyTexturetoCubeTexture (Texture,Texture2[,side]) -> copy a texture to all or one side of a cube textur
No please :!:

Don't add nonsense commands to your lib.

Please work on the EntityLookAt(), there is a bug as I explained, and as a request add a PointEntity(*Entity,*EntityToPointTo).
And please, Add a flag for MoveEntity which allows this function to Move an entity relative to its current position and orientation , because the current function just allow only to Moves an entity relative to its current position.
With this last function implemented there can be done a Orbitation for one entity over another with just only 3 commands. I just will post this simple orbit function.

Re: MP3D Engine Alpha 32

Posted: Thu Nov 27, 2014 10:01 pm
by N_Gnom
i would change to unity....
i´ll wait for some updates....but nothing happens....
best wishes for all here

Re: MP3D Engine Alpha 32

Posted: Thu Nov 27, 2014 11:36 pm
by Psychophanta
Psychophanta wrote: Please work on the EntityLookAt(), there is a bug as I explained, and as a request add a PointEntity(*Entity,*EntityToPointTo).
And please, Add a flag for MoveEntity which allows this function to Move an entity relative to its current position and orientation , because the current function just allow only to Moves an entity relative to its current position.
With this last function implemented there can be done a Orbitation for one entity over another with just only 3 commands. I just will post this simple orbit function.
There is also missed:
MP_RotateMesh() ; Do a rotation of all the vertices of the mesh.

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 3:15 pm
by mpz
Hi to all,

here comes a little Update, but only for x86, PB 5.11 and 5.24 and greater:

1) I think the installer file has had a bug and installed the wrong version. I hope i found the bug and this new installer works fine. Please test it:

To install only the lib please choose "MP3DLib only"
http://www.flasharts.de/mpz/mp33_beta/M ... taller.exe

2) Two new commands are ready, i need them for a shader -> see Demo

MP_CreateCubeTexture(Size(,Miplevel)) -> Create empty six side cube texture
MP_CopyTexturetoCubeTexture (Texture,Texture2[,side]) -> copy a texture to all or one side of a cube textur

Shaderdemo
http://www.flasharts.de/mpz/mp33_beta/Shaderdemo.exe

3) I have MP_Lookat(Camera...) actualiced. I think this works now correct. Please test it

Code: Select all

MP_Graphics3D(640,480,0,3)
camera=MP_CreateCamera()

MP_PositionEntity(camera,0,0,0)

Debug "Camera Pitch/Yaw/Roll"
Debug MP_EntityGetPitch(camera)
Debug MP_EntityGetYaw(camera)
Debug MP_EntityGetRoll(camera)

MP_EntityLookAt(camera,0,0,3) ; <- Un-remark this line to see what happens

Debug "Camera Pitch/Yaw/Roll after lookat"
Debug MP_EntityGetPitch(camera)
Debug MP_EntityGetYaw(camera)
Debug MP_EntityGetRoll(camera)


light=MP_CreateLight(1)
mesh=MP_CreateCube()
MP_PositionEntity(Mesh,0,0,3)

While MP_KeyUp(#PB_Key_Escape) And WindowEvent()

<>#PB_Event_CloseWindow
  If MP_KeyDown(#PB_Key_Right):MP_MoveEntity(camera,0.01,0,0)
  ElseIf MP_KeyDown(#PB_Key_Left):MP_MoveEntity(camera,-0.01,0,0)
  ElseIf MP_KeyDown(#PB_Key_Up):MP_MoveEntity(camera,0,0.01,0)
  ElseIf MP_KeyDown(#PB_Key_Down):MP_MoveEntity(camera,0,-0.01,0)
  ElseIf MP_KeyDown(#PB_Key_A):MP_MoveEntity(camera,0,0,0.01)
  ElseIf MP_KeyDown(#PB_Key_Z):MP_MoveEntity(camera,0,0,-0.01)
  EndIf
  MP_RenderWorld()
  MP_Flip()
Wend
Now the next case:

@N_Gnom i am sorry to hear this. Okay what can we do to make it better? I will have more time in the next weeks an can work on mp3d

- If anybody find a bug or whant to have a function please write here a message with problem or error message and a testcode. Please only one case per message :)
* I will check this and make an answer. Somtimes a wish is not possible to create but i do my best

@Psychophanta
* "Move an entity relative to its current position and orientation" is not needed because the command MP_MoveEntity(..) do this

Code: Select all

MP_Graphics3D(640,480,0,3)
camera=MP_CreateCamera()

MP_PositionEntity(camera,0,0,0)
light=MP_CreateLight(1)
mesh=MP_CreateCube()
MP_PositionEntity(Mesh,0,0,3)

MP_TurnEntity(Mesh, 0, 0,45)

While MP_KeyUp(#PB_Key_Escape) And WindowEvent()<>#PB_Event_CloseWindow
  
  If MP_KeyDown(#PB_Key_Right):MP_MoveEntity(Mesh,0.01,0,0)
  ElseIf MP_KeyDown(#PB_Key_Left):MP_MoveEntity(Mesh,-0.01,0,0)
  ElseIf MP_KeyDown(#PB_Key_Up):MP_MoveEntity(Mesh,0,0.01,0)
  ElseIf MP_KeyDown(#PB_Key_Down):MP_MoveEntity(Mesh,0,-0.01,0)
  EndIf 
  
  MP_TurnEntity(Mesh, 0, 0,0.1)

  MP_RenderWorld()
  MP_Flip()
Wend
* MP_RotateMesh() is not needed because i have made the command MP_ChangeMeshCoord(Entity). This function is better. You can make a
rotation and change the position of the vertices. Please have a look on the demofile "MP_Spikes.pb".

i hope this helps
Greetings Michael

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 5:35 pm
by Psychophanta
mpz wrote:
* "Move an entity relative to its current position and orientation" is not needed because the command MP_MoveEntity(..) do this
Ok, then there is needed a flag to move it relatively to its current position only.
mpz wrote: * MP_RotateMesh() is not needed because i have made the command MP_ChangeMeshCoord(Entity). This function is better. You can make a
rotation and change the position of the vertices. Please have a look on the demofile "MP_Spikes.pb".
You need to perform MP_RotateEntity() before MP_RotateMesh() , which means you can not perform a Mesh rotation over global axises X, Y, and Z.

So, you can do whatever you want, but the result of success of your lib is the one the lib deserves.

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 7:20 pm
by IdeasVacuum
MP3D is already looking very good. When the release version is ready, I think it is going to be very popular. Keep up the good work mpz.

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 7:33 pm
by mpz
Hi,

@ Psychophanta
mpz wrote:
* "Move an entity relative to its current position and orientation" is not needed because the command MP_MoveEntity(..) do this
Ok, then there is needed a flag to move it relatively to its current position only.
* It is possible to create this flag. In the normal way you can use a variable and use the mp_PositionEntity(..) command.
mpz wrote:* MP_RotateMesh() is not needed because i have made the command MP_ChangeMeshCoord(Entity). This function is better. You can make a
rotation and change the position of the vertices. Please have a look on the demofile "MP_Spikes.pb".
You need to perform MP_RotateEntity() before MP_RotateMesh() , which means you can not perform a Mesh rotation over global axises X, Y, and Z.
* Here i dont understand what exactly you want to to ?!? Can you explain or give me a demo code. you can use your lovely DM3D to create this demo too (, i have the sourcecode of them and can look on it).
P.S. I think you can scale, move and rotate a vertices over a "global axises X, Y, and Z" with this commands...
So, you can do whatever you want, but the result of success of your lib is the one the lib deserves. Sorry.
It is easier for me to help customer they write a project and need help with some functions they need an they dont work. I dont think that if if i wrote more commands that the lib "success" better. I know that the mp3d lib has some special featured that no other 3d engine has, but this is (only) my opinion.....

@IdeasVacuum
* Thanks...


Greetings Michael

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 9:40 pm
by Psychophanta
I see, dear Michael.
However, allow me to say you that you have added 2 functions which are not useful, since it can be done easely using u, and v for the vertex, etc.
Any serious programmer, when see incoherence in the functions collection , then he will abandon, at least it happens to me, just because don't see average seriousness in the lib.

About RotateMesh() :
To see what i meant about the RotateMesh() look this:
http://www.purebasic.fr/english/viewtop ... 97#p456997
Posted on (Sun Nov 30, 2014 20:21)
This can not made easely in MP3D.

About the flag for MoveEntity(), ok, there not needed since is enough with PositionEntity(..) command using deltas (increments).

About EntityLookAt(), there is a bug, or at least a strange behaviour which should be repaired. With DM3D there is PointEntity() instead of EntityLookAt(), and its behaviour is correct.

Thanks!

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 10:30 pm
by mpz
Hi,

@ Psychophanta

1) Please send me the sourcecode of the ari testecode, i will have a look on it and show what mp3d can do

2) EntityLookAt(), i think camera is okay now. If you make a democode with the "strange behaviour" of the other entitys i can repair it

Greetings
Michael

Re: MP3D Engine Alpha 32

Posted: Sun Nov 30, 2014 10:41 pm
by Psychophanta
1) See PM

2) Look at this. It should orbitate Camera over the teapot, but it does not because your EntityLookAt() function is wrong:

Code: Select all

ExamineDesktops()
Global bitplanes.b=DesktopDepth(0),RX.w=DesktopWidth(0)/2,RY.w=DesktopHeight(0)/2
MP_Graphics3D(RX,RY,0,1):MP_VSync(1)
SetWindowTitle(0,"Press left/Right move pivot _ Up/Down rotate pivot")
Procedure MP_PointEntity(c,o)
;   Protected cx.f=MP_EntityGetX(c),cy.f=MP_EntityGetY(c),cz.f=MP_EntityGetZ(c)
  Protected ox.f=MP_EntityGetX(o),oy.f=MP_EntityGetY(o),oz.f=MP_EntityGetZ(o)
;   Protected vx.f=ox-cx,vy.f=oy-cy,vz.f=oz-cz
;   Protected d.f=Sqr(vx*vx+vy*vy+vz*vz)
;   MP_RotateEntity(c,ACos(vx/d)*180/#PI,ACos(vy/d)*180/#PI,ACos(vz/d)*180/#PI,0)
  MP_EntityLookAt(c,ox,oy,oz)
EndProcedure
Procedure.f MP_EntityDistance(c,o)
  Protected vx.f=MP_EntityGetX(o)-MP_EntityGetX(c),vy.f=MP_EntityGetY(o)-MP_EntityGetY(c),vz.f=MP_EntityGetZ(o)-MP_EntityGetZ(c)
  ProcedureReturn Sqr(vx*vx+vy*vy+vz*vz)
EndProcedure
light=MP_CreateLight(2)
MP_LightSetColor(light,RGB(219,118,50))
MP_PositionEntity(light,-6,10,-5)
MP_AmbientSetLight(RGB(0,100,200))
mesh=MP_CreateTeapot()
camera=MP_CreateCamera()
MP_PositionEntity(camera,0,5,-30)
Procedure Orbitar(c,dx.d,dy.d,dz.d,o,r.d)
  ;Funcion para orbitar una entidad '*c' alrededor de otra '*o' siendo 'dx' y 'dy' los incrementos de las coordenadas sobre la superficie de una esfera de orbitación de radio 'r'. 'dz' es el incremento del radio 'r'.
  ;Function to make a 3D entity '*c' to orbitate around another 3D entity '*o' being 'dx' y 'dy' the increments of the coords over the orbitation sphere surface with radius 'r'. 'dz' is the increment of the radius 'r'.
  MP_MoveEntity(c,dx,dy,0)
  MP_PointEntity(c,o)
  MP_MoveEntity(c,0,0,Sqr(dx*dx+dy*dy+r*r)-r+dz)
EndProcedure
m.f=MP_EntityDistance(camera,mesh)
Repeat
  Orbitar(camera,-MP_MouseDeltaX()/60,MP_MouseDeltaY()/60,MP_MouseDeltaWheel()/3,mesh,m)
  MP_RenderWorld()
  MP_Flip()
Until MP_KeyHit(#PB_Key_Escape)

Re: MP3D Engine Alpha 32

Posted: Mon Dec 01, 2014 12:29 pm
by applePi
Hi Michael
i have installed your Library using the new http://www.flasharts.de/mpz/mp33_beta/M ... taller.exe full install. on purebasic 5.31 but trying to run any example it gives this error:
Polink: fatal error: File not found: 'D3D9.LIB'
i have searched for the D3D9.Lib in PB folder , and its name now is Librariesd3d9.Lib
i have copied the d3d9.* from an older version and it does not work.
by the way your http://www.flasharts.de/mpz/mp33_beta/[b]Shaderdemo.exe[/b] are extremely beautiful .

Re: MP3D Engine Alpha 32

Posted: Mon Dec 01, 2014 2:46 pm
by mpz
Hi,

@aaplePi

you can install the libs manually:
lib for 32 Bit Purebasic
http://www.flasharts.de/mpz/mp33_beta/lib32/Lib32.zip

* Please unzip the file an copy it in the "PureBasic\PureLibraries\Windows\Libraries" folder

lib for 64 Bit Purebasic
http://www.flasharts.de/mpz/mp33_beta/lib64/Lib64.zip

* Please unzip the file an copy it in the "PureBasic\PureLibraries\Windows\Libraries" folder

or (better) use the Installer

http://www.flasharts.de/mpz/mp33_beta/M ... taller.exe

Greetings Michael

Re: MP3D Engine Alpha 32

Posted: Mon Dec 01, 2014 7:10 pm
by N_Gnom
is the last link the installer with the lib for 5.31?

Re: MP3D Engine Alpha 32

Posted: Mon Dec 01, 2014 8:40 pm
by applePi
@N_Gnom , yes it is for pb 5.31 (online install) , but still you need to unzip the file http://www.flasharts.de/mpz/mp33_beta/l ... ]Lib32.zip[/b] to "PureBasic\PureLibraries\Windows\Libraries" folder as stated above.

Re: MP3D Engine Alpha 32

Posted: Tue Dec 02, 2014 8:49 am
by N_Gnom
okay.
I´ve do this.