MP3D Engine Alpha 33

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: MP3D Engine Alpha 32

Post by applePi »

Hi AndyLy
i have installed the new mp3d on Purebasic v5.00 (i have many versions on the same C:\) but i run it in winxp not win7 like you, it runs okay from the ide or as a compiled .exe. i have used the following code, have you tried to right click the exe file then choose run as administrator ?

Code: Select all

Global xres=800, yres=600
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "plane")

camera=MP_CreateCamera()

light=MP_CreateLight(2)
MP_InitShadow()
Width=256
Height=256

;to make a background with gradient color
If CreateImage(0, Width, Height)
  MP_CreateImageColored(0, 0, RGB(0,255,255), RGB(0,255,255), RGB(200,0,255), RGB(200,0,255))     
EndIf
Surface = MP_ImageToSurface(0,0)
FreeImage(0)
MP_SurfaceSetPosition(Surface,0,0,1)
MP_SurfaceDestRect(Surface,0, 0, xres, yres)

texture = MP_CreateTextureColor(256, 256, RGBA(0, 0, 255, 255))

plane = MP_CreatePlane(1, 1)
MP_ScaleMesh(plane, 4, 4, 4)

MP_EntitySetTexture(plane, texture)
MP_RotateEntity(plane, 90, 0, 90)
MP_PositionEntity(light, 0, 20, 20)
MP_EntityLookAt(light,0,0,0)

MP_PositionCamera (Camera, 3, 2, 6)
MP_CameraLookAt(Camera,0,0,0)         

While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
       
    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 32

Post by AndyLy »

Hi applePi
The same situation with your code- plane does not displayed in exe. Even if run as administrator.
In Ide- work fine.

p.s. Just tried it on Windows XP- is the same. I do not understand what could be the reason.

p.p.s. It was a bug related to the use of D3dx9_43.dll. I removed it and now exe file also works fine.
'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 32

Post by applePi »

Hi Alexi , there are 8 functions to deal with the animated models with bones can be loaded with MP_LoadAnimMesh(Files.s), you can choose the animation index by MP_SetAnimationSet(AnimMesh , index)
look the animation mesh functions in the help
i think it is available only for animated DirectX mesh (*.x files)
look Mesh\MP_3_AnimMesh.pb and Mesh\MP_AnimDemo.pb . i never used bones before so if someone have more info .
if there are some bones related functions needed and it is available in DirectX 9 then i'm sure Michael will implement it.
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: MP3D Engine Alpha 32

Post by Sveinung »

Some sprite fun withe Aplha32

Image

Code: Select all

MP_Graphics3D(640,480,32,1)

s1=MP_LoadSprite("32.png")

Repeat
  ang.f+0.05
  d.f=0.1
  For x=0 To 640 Step 40
    dy1=Sin(ang+d)*40
    dy2=Sin(ang+d)*80
    dy3=Sin(ang+d)*120
    MP_DrawSprite(s1,0+x,240)
    MP_DrawSprite(s1,0+x,240+dy1)
    MP_DrawSprite(s1,0+x,240-dy1)
    MP_DrawSprite(s1,0+x,240+dy2)
    MP_DrawSprite(s1,0+x,240-dy2)
    MP_DrawSprite(s1,0+x,240+dy3)
    MP_DrawSprite(s1,0+x,240-dy3)
    d+0.1
  Next
  MP_RenderWorld()
  MP_Flip()
Until MP_KeyHit(#PB_Key_Escape)
Regards
Sveinung
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: MP3D Engine Alpha 32

Post by applePi »

thank you Sveinung, a beautiful demonstration, i have tried it in PB 5.11
since in 5.20 Beta5 it issue a message: PureBasic library missing: Misc(needed by 'MP3D_Library' library)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: MP3D Engine Alpha 32

Post by Andre »

applePi wrote:thank you Sveinung, a beautiful demonstration, i have tried it in PB 5.11
since in 5.20 Beta5 it issue a message: PureBasic library missing: Misc(needed by 'MP3D_Library' library)
As the former 'Misc' library was split off and their commands are included in several other libraries (2DDrawing, Math, ...) this UserLib needs to be re-compiled using the actual PB-Compiler for PB5.20 to work again...
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Szafir
New User
New User
Posts: 5
Joined: Mon Oct 12, 2009 11:47 am

Re: MP3D Engine Alpha 32

Post by Szafir »

Would it be possible to the engine as dll?

Sorry for my english.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: MP3D Engine Alpha 32

Post by IceSoft »

Szafir wrote:Would it be possible to the engine as dll?
I am not sure. The sentence below can be found on the FAQ page of PB:
Is it allowed to use DLLs made with PureBasic in other projects ?
Generally yes. You can make DLLs including PureBasic commands for your own projects without any restrictions. But it's not allowed to release simple "wrapper" Dlls to include PureBasic commands in other programming languages.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Szafir
New User
New User
Posts: 5
Joined: Mon Oct 12, 2009 11:47 am

Re: MP3D Engine Alpha 32

Post by Szafir »

In fact, the engine is tightly integrated with PureBasic.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: MP3D Engine Alpha 32

Post by applePi »

Hi Michael, when you return home if possible to check the MP_ChangePhysikHull you have added recently since it seems not implemented in the new posted alpha 32, also if possible an example of its usage.
thanks
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: MP3D Engine Alpha 32

Post by Sveinung »

and some more sprite (yes..I'm bored)

Use image from my last post

Code: Select all

MP_Graphics3D(640,480,32,1)

tot_Stars=88

sp1=MP_LoadSprite("64.png")

Structure sdata
  plus.f
  scale.f
  cnt.i
EndStructure

Dim stars.sdata(tot_Stars)

For i=0 To tot_Stars
  stars(i)\plus=1
  stars(i)\scale=10
  stars(i)\cnt=0-(i*10)
Next

Repeat
  ang.f+0.04
  For i=0 To tot_Stars
    MP_SpriteSetZ(sp1,i/100)
    dx.f=Sin(ang-i)*stars(i)\plus
    dy.f=Cos(ang-i)*stars(i)\plus
    dd.f=32*(stars(i)\scale/100)
    MP_ScaleSprite(sp1,stars(i)\scale,stars(i)\scale)
    MP_DrawSprite(sp1,(320-dd)+dx,(240-dd)+dy)
    stars(i)\cnt+1
    If stars(i)\cnt>10
      stars(i)\scale+2
      stars(i)\plus+3
      stars(i)\cnt=0
      If stars(i)\scale>160
        stars(i)\scale=10
        stars(i)\plus=1
      EndIf
    EndIf
  Next
  MP_RenderWorld()
  MP_Flip()
Until MP_KeyHit(#PB_Key_Escape)
Regards
Zzzzzzzzzzzzzzveinung :mrgreen:
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 32

Post by mpz »

Hi,

to all, i am back. The first bad news, i cant recompile my lib with PB 5.2. There comes an error message "label not found". It could be a pointer problem with 5.2 and tailbite, but i am working on it and with the good help from the tailbite team we find a solution.

@AndyLy, i hope everything works now?!?

@Alexi, Bones, Anim Mesh in MP3d works with DX9 Animmesh X files, a good information side are here
http://www.toymaker.info/Games/html/loa ... chyConcept

@Sveinung, nice Demo thanks

@Andre, Misc lib is missing message appears, yes i must re-compile the lib if i found the problem ;)

@Szafir, yes it is possible, but i need a reason why? I will animate programer to use pb for 3d... and before i must ask Fred, i dont want to make a simple "wrapper" with my engine :) :) :)

@applePi, have you seen the MP_Physic_Primitives.pb example? If you change a MP3d_mesh for example with the MP_VertexSet command you actualize the meshphysic of the mesh with the command MP_ChangePhysicHull(Mesh, Typ)

@Sveinung, nice Demo thanks

@Alexi multiple Screen, not for now. I will check it but it will be a big work to change these function

Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: MP3D Engine Alpha 32

Post by AndyLy »

Hi Michael, I hope you had a good rest .
to all, i am back. The first bad news, i cant recompile my lib with PB 5.2. There comes an error message "label not found". It could be a pointer problem with 5.2 and tailbite, but i am working on it and with the good help from the tailbite team we find a solution.

@AndyLy, i hope everything works now?!?
I am not planning to move to the PB 5.2 , because with each update changes are more radical.
I don't want every time remake my big codes and have not working additional libraries.
Actually, I think very soon the PB will be completely different, a new language, which will have to study again.

============================
Now that you are back, maybe you want to do what I have long asked: adding additional layers of texture objects . Cite this quote :

Code: Select all

I would like to add layers of texture. Ie there is a basic, large texture and later I add  details texture on arbitrary coordinates .
I added the procedure, as I do now . I hope you understand what I'm doing :
StartDrawing(ImageOutput(LayTex(lrd_tex)\baseimg))
  ForEach LayTex()\layer()
DrawAlphaImage(ImageID(LayTex()\layer()\image),LayTex()\layer()\x,LayTex()\layer()\y)
  Next: StopDrawing()
     texture=MP_ImageToTexture(LayTex()\baseimg,0,0,mip)
'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
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 32

Post by mpz »

Hi Andyly,

i think these function can i implement. What kind of function do you need?

The texture overwrite on this place ?
The texture will be add on this place ?
The texture overwrite with alphafunction on this place ?

Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
AndyLy
Enthusiast
Enthusiast
Posts: 228
Joined: Tue Jan 04, 2011 11:50 am
Location: GRI

Re: MP3D Engine Alpha 32

Post by AndyLy »

"The texture overwrite with alphafunction on this place ?"

That there was no misunderstanding, I will explain with pictures.
1 - base texture, 2 - texture with alpha; 3 - result

Image

I think it should be a command like MP_AddTextureLayer(base_tex, add_tex, x, y, trans=255)
'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