It is currently Fri May 24, 2013 4:30 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 378 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12 ... 26  Next
Author Message
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Wed Jun 13, 2012 11:44 am 
Offline
Enthusiast
Enthusiast

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

thanks for your good informations of your tests. I test mp3d it with older grafic card too. Perhaps it is the solution (16bit) of the shadow texture i create for the shadow. I will make a new exe for testing. I think it will be a little problem and we find the solution.

Greetings Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Wed Jun 13, 2012 2:14 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 229
Hi
i have found something which may be important, the talk below is while using windows xp only since in windows 7 using MP_InitShadow() produce an error on my system
you may not believe that but i am using always a 640 X 480 resolution. i don't like 800x600 or above resolutions. so running the shadows programs and your MP_Schachdemo.exe indeed they produce a shadow but it is overwhelming and big shadow that cast it self over the whole objects. and when i have changed the resolution to 800x600 the shadow appears look the picture running MP_ChessShadow.pb or MP_Schachdemo.exe the same with the above resolutions and the same whether using 32bit color quality or 16bit.
http://s13.postimage.org/vz76s4cmf/chess_Shadow.png
now i have run your MP_01_Primitives.pb its falling objects (spheres, pyramids, else) are colorfull without using MP_InitShadow() as it is originally like this picture:
http://s15.postimage.org/wva3qyzsb/shadow_Disabled.png

but when i have inserted MP_InitShadow() in the code , there is shadow but with a problem: the falling objects are black and not colored
http://s10.postimage.org/vmzs0vlh5/shadow_Enabled.png

note: since the new vga cards don't have the 640x480 res, you can use the xp_quickres http://www.dougknox.com/xp/utils/xp_quickres.htm to change to any resolution it can be used also in windows 7, its icon appears on the taskbar

regards


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Wed Jun 13, 2012 3:16 pm 
Offline
Enthusiast
Enthusiast

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

oh, my shadowmap have the size 512x512 and cant create on 640x480. I have created some testfiles and please test them and show me the solution:

Shows normal shader demo with 16 Bit Shadow
http://www.flasharts.de/mpz/Shadowdemo2.exe

Shows Chess shader demo with 24 Bit Shadow
http://www.flasharts.de/mpz/Shadowdemo3.exe

shows stencil sides
http://www.flasharts.de/mpz/Shadowdemo4.exe

Greetings Michael

_________________
Working on - MP3D Library -


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Wed Jun 13, 2012 5:00 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 229
thank you, your programs now display shadow in the 640x480 resolution
using winxp: (using 32bit color) and the same as in 16bit color)
http://s16.postimage.org/nnmk4v3o5/Shad ... 40x480.png
http://s7.postimage.org/i0yxfl6nf/Shado ... 00x600.png

http://s17.postimage.org/43o22rven/Shad ... 40x480.png
http://s16.postimage.org/vs3v134ut/Shad ... 00x600.png

http://s15.postimage.org/isekoob6z/Shad ... 40x480.png
Shadowdemo4_800x600.png the same as above

in the windows 7 it gives as before this error: error CreateEffect!
http://s7.postimage.org/e7nupeiuj/win7.png
the Shadowdemo4.exe gives first the above error then when clicking okay it display the result as in the :
http://s15.postimage.org/isekoob6z/Shad ... 40x480.png

regards


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Fri Jun 15, 2012 2:34 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 229
Hi
have you though before to make a general purpose dll of your engine so it can be called from any windows programming language , an example is the free darkgdk http://www.thegamecreators.com/?m=view_product&id=2128 which was once upon time advertised on the microsoft vc++ 2008 express ed page , and some educational institutions have adopted that free version to teach c++ by using graphics from darkgdk ie like learning through playing with toys. of course darkgdk are calling the directx/direct3d functions like darkbasic do.
your engine are doing the same by using purebasic.
any general ideas about the possiblity of a general purpose dll of your engine. so it can be used by more people from several programming languages.
regards


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Sun Jun 17, 2012 5:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jan 12, 2009 10:33 am
Posts: 274
Have a look at DarkGDK 2.0 it's currently in release candidate status and comes in a form of single dll file. Out of the box it supports C++, PureBasic, .Net. Experimental Java and D language support is in progress. Best part is that it comes with SDK that allows you to generate headers for any language that supports DLL calls. Compared to DarkGDK 1.0 it is faster, has better documentation and is generally more up to date. Besides there's now a dedicated developer who is working solely on GDK 2.0 and will be able to fix long standing issues with DBPro that are present in GDK as well. Future looks bright. You can try the RC now (it is free but will expire at some point).

http://www.purebasic.fr/english/viewtopic.php?f=14&t=49977

_________________
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 7 HP (x64), DirectX 11, PureBasic 5.11 (x86)


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Sun Jun 24, 2012 9:27 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 229
Hi
i am studying the example MP_PickingTriangle.pb from the picking demos in the MP3D examples.
it works perfect, but i have some trouble understanding how the triangle indexes works. in the attached image in the triangle index 1:
Image

the index0 = 1, index1 = 12, index2 = 0. i was expecting that the indexes go like this for the first triangle 0,1,2 and for the second triangle like this 3,4,5 but here for the second triangle it is 12, 11, 0. so how indexes numbering works here.
second question (or wish):
if the MP_EntityGetTriangle(mesh, triangleindex, 0) determines the index number of a vertex point of a specific triangle in a mesh, i wish that we can change the specific vertex point coordinates of a specific triangle something like MP_EntitySetTriangleZ(mesh, triangleIndes,0)
and MP_EntitySetTriangleX, MP_EntitySetTriangleY. just a suggestion
thanks


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Mon Jun 25, 2012 9:24 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1284
Location: Waterloo, WI - USA
For some reason I can't extract your MP3D .zip download.

When I try with Windows Explorer I just get a generic error.
When I try with 7zip I get a CRC error on setup_mp3d_30.exe saying the file is broken

_________________
Image


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Mon Jun 25, 2012 10:18 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 24, 2008 12:21 am
Posts: 256
you can use this download for MP3D version 30 instead:
Download
I checked this file, no problem with winrar.

_________________
pb 5.11


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Tue Jun 26, 2012 5:27 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1284
Location: Waterloo, WI - USA
Thanks, that download worked.. Now to see if I can understand any of this :o

_________________
Image


Top
 Profile  
 
 Post subject: textured animated 3D curves
PostPosted: Thu Jun 28, 2012 5:12 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 229
here is how to draw a textured animated 3D curves, it depends on the MP3D ability to change dynamically the model vertices coordinates even the real models such as 3ds models. i have used as a template the example by Michael "MP_Bewegende Objekte.pb" from the MP3D library examples\mesh.
i have used a plane 30x30 so it has 961 vertices (31x31). the plot range for the first example is from -3 ro +3 so we need to project the real plot to the 30x30 plane. we just multiply the x,y vertices of the plane by 6/30.
the first example will plot a curve resemble a flying carpet textured by a tiger fur. save the texture from here http://s13.postimage.org/b88odkv3r/tiger.png to the program folder. you can tune the figure by changing the timer values, or more or less z values.
Code:
;//published originally by Michael Paulwitz as the library example "MP_Bewegende Objekte.pb"
;//used and modified here to draw a 3D curve
MP_Graphics3D (640,480,0,3) ; Erstelle ein WindowsFenster #Window = 0
SetWindowTitle(0, "3D animated curves _ use arrow keys to rotate,..... z, x    to zoom  in/out") ; So soll es heissen

camera=MP_CreateCamera() ; Kamera erstellen

camX.f=0 : camY.f=0 : camZ.f = -40 : rotX=0: rotY=45
Global timer.l: Global tX.f,tY.f,tZ.f
tX=-3.2:tY=-3
MP_PositionCamera(camera,camX,camY,camZ)
light=MP_CreateLight(2)
light2=MP_CreateLight(2)

MP_LightSetColor(light,RGB(255,255,255))
MP_LightSetColor(light2,RGB(255,255,255))
MP_AmbientSetLight (RGB(255,220,255))


MP_PositionEntity(light,0,50,-60)
MP_PositionEntity(light2,0,100,60)

plane=MP_CreatePlane(30,30) ;the plane used for draw
teapot=MP_CreateTeapot() ; just a fantasia

texture =  MP_LoadTexture("tiger.png")
;texture = MP_CreateTextureColor(256, 256, RGBA(0, 255, 255, 255))
MP_EntitySetTexture(plane, texture)
MP_MaterialEmissiveColor (texture, 0, 0, 0, 0)
;MP_MaterialSpecularColor(plane,1,255,10,0,1)

For n = 0 To MP_CountVertices(plane)-1

          farbea.l = Random(255)
          farbeb.l = Random(255)
          farbec.l = Random(255)

          ;uncomment the below line to enable colorfull demo
          ;MP_VertexSetColor (plane,n,RGB(farbea,farbeb,farbec))
          ;MP_VertexSetColor (plane,n,RGB(255,100,0))
Next

;MessageRequester("",Str(MP_CountVertices(plane)))
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder schliessen
   
  ;play with timer values to tune nore
  timer = MP_ElapsedMicroseconds()/200
  For n = 0 To MP_CountVertices(plane)-1
        x.f = MP_VertexGetX (plane,n)
        y.f = MP_VertexGetY (plane,n)
        z.f = MP_VertexGetZ (plane,n)
       
        ;projecting the draw from -3 to 3 over -15 to 15:
        x=x*6/30: y=y*6/30
       
        ;zufall.f = (Cos(timer/600+(Pow(x*(6/30),2)+Pow(y*(6/30),2))/4))/(Pow(x,2) + Pow(y,2) + 3.1415/9)
        ;zufall.f = (Cos(timer/600+(Sqr(Pow(2*x*(6/30),2)+Pow(2*y*(6/30),2)))))
        zufall.f = (Sin(timer/100+x)+Sin(timer/100+y))/5
        ;MP_VertexSetX (plane,n, x + zufall)
        ;MP_VertexSetY (plane,n, y + zufall)
        MP_VertexSetZ (plane,n, z + zufall)
        If n=900
          zufall.f = (Sin(timer/100+0*(6/30))+Sin(timer/100+(-1)*(6/30)))/5
          MP_PositionEntity(teapot,0,z+zufall,-1)
        EndIf 


   Next
   
   If MP_KeyDown(#PB_Key_Up)
     rotY+1
     ElseIf MP_KeyDown(#PB_Key_Down)
     rotY-1
     ElseIf MP_KeyDown(#PB_Key_Right)
     rotX+1
     ElseIf MP_KeyDown(#PB_Key_Left)
     rotX-1
     ElseIf MP_KeyDown(#PB_Key_Z ) 
     camZ+1
     ElseIf MP_KeyDown(#PB_Key_X )   
     camZ-1
   
   EndIf
   
   MP_RotateEntity(plane, rotX, rotY, 0 )
   MP_PositionCamera(camera,camX,camY,camZ)
   MP_RenderWorld ()
   MP_Flip () ;

Wend

End


Image

if you want to try more functions uncoment one of another 2 functions in the code

the other code resemble the example posted here viewtopic.php?f=7&t=50171 but to plot a textured 3D letter 'A' , save this texture to use : http://s18.postimage.org/hvzb0h2s9/snake.png
. and the plot are from -1 to +1 so we have to multiply the 30x30 plane x,y by 2/30, there is no timer here since we want to plot only the z values.
Code:
;//published originally by Michael Paulwitz as example "MP_Bewegende Objekte.pb"
;//used and modified here to show textured 3D 'A' letter
MP_Graphics3D (640,480,0,3)
SetWindowTitle(0, "3D animated curves _ use arrow keys to rotate,..... z, x    to zoom  in/out") ; So soll es heissen

camera=MP_CreateCamera()

camX.f=0 : camY.f=0 : camZ.f = -60 : rotX=0: rotY=0: rotZ=-90
Global timer.l: Global tX.f,tY.f,tZ.f
tX=-3.2:tY=-3
MP_PositionCamera(camera,camX,camY,camZ)
light=MP_CreateLight(2)
MP_LightSetColor(light,RGB(255,255,255))
MP_AmbientSetLight (RGB(255,220,255))

MP_PositionEntity(light,0,50,-60)

plane=MP_CreatePlane(30,30)
tea=MP_CreateTeapot()

texture =  MP_LoadTexture("snake.png")
MP_EntitySetTexture(plane, texture)
MP_MaterialEmissiveColor (texture, 0, 0, 0, 0)
;MP_MaterialSpecularColor(plane,1,255,10,0,1)
;MessageRequester("",Str(MP_CountVertices(plane)))
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder schliessen
   
    For n = 0 To MP_CountVertices(plane)-1
        x.f = MP_VertexGetX (plane,n)
        y.f = MP_VertexGetY (plane,n)
        z.f = MP_VertexGetZ (plane,n)
       
        x=x*2/30: y=y*2/30
       
        zufall.f = ((1-Sign(-x-0.9+Abs(y*2)))/3*(Sign(0.9-x)+1)/3)*(Sign(x+0.65)+1)/2 -((1-Sign(-x-0.39+Abs(y*2)))/3*(Sign(0.9-x)+1)/3) + ((1-Sign(-x-0.39+Abs(y*2)))/3*(Sign(0.6-x)+1)/3)*(Sign(x-0.35)+1)/2
        MP_VertexSetZ (plane,n, -zufall*40)
       
   Next
   
   If MP_KeyDown(#PB_Key_Up)
     rotY+1
   ElseIf MP_KeyDown(#PB_Key_Down)
     rotY-1
   ElseIf MP_KeyDown(#PB_Key_Right)
     rotX+1
   ElseIf MP_KeyDown(#PB_Key_Left)
     rotX-1
   ElseIf MP_KeyDown(#PB_Key_Z ) 
     camZ+1
   ElseIf MP_KeyDown(#PB_Key_X )   
     camZ-1
     
   
   EndIf
   
    MP_RotateEntity(plane, rotX, rotY, rotZ )
    MP_PositionCamera(camera,camX,camY,camZ)
    MP_RenderWorld ()
    MP_Flip () ;

Wend

End


Image

to experiment with more 3D functions look http://www.benjoffe.com/code/tools/functions3d/examples

i am still studying the MP3D since it is so huge, i just use a small part of it wich deals with vertices for plotting and deforming.
at last where are you Michael !! i hope you are okay.
regards


Top
 Profile  
 
 Post subject: Re: textured animated 3D curves
PostPosted: Thu Jun 28, 2012 8:12 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1300
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
applePi wrote:
at last where are you Michael !! i hope you are okay.
regards

He is on vacation for two weeks.

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


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Sat Jun 30, 2012 12:52 am 
Offline
User
User

Joined: Sat Nov 08, 2008 8:19 pm
Posts: 94
I got a questions...

I have done well using first Intro Demo of using MP3D of putting two things together to make intro.

I have start to make my own Folder then went on Purebasic IDE and I make new Project then starting doing some MP3D Engine coding.... why does cause Error when say

Line 9: EP_InitFXLib() is not a function, Array, Marcro or linked list...

Do I have add library files in my own folder?

P.S. MP3D is Great Engine :mrgreen:


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Sat Jun 30, 2012 7:06 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 24, 2008 12:21 am
Posts: 256
did you activate "dx9" subsystem?

_________________
pb 5.11


Top
 Profile  
 
 Post subject: Re: MP3D Engine Alpha 30
PostPosted: Sat Jun 30, 2012 9:26 am 
Offline
User
User

Joined: Sat Nov 08, 2008 8:19 pm
Posts: 94
Quote:
did you activate "dx9" subsystem?


How do I do that? :?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 378 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12 ... 26  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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