Hi Michael
just some wishes for the future MP3D versions
1-
MP_SetPixel3D(x,y,z,color) to put a pixell in a 3D space
2- shadow with color such as
MP_InitShadow(1, color,intensity)
3- solving the shadow problem in wich when the light are at low height then there is an additional shadow at the edges of the plane
in the attached code here the sphere just denote where the light is.
when we put the light higher the erroneous shadows at the edges will be shifted more far from center. in the following code press Z key to shift light higher and the edges shadows will be out of sight and thats good, press X key to shift light lower but the edges shadows will appear again.
Code: Select all
Global xres=640, yres=480
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "shadow, press Z, X keys to shift light higher or lower")
;MP_Wireframe(1)
camera=MP_CreateCamera()
light=MP_CreateLight(2)
MP_LightSetColor (light, RGB(255,255,255))
MP_InitShadow()
Width=256
Height=256
texture2 = MP_CreateTextureColor(256, 256, RGBA(0, 255, 255, 0))
texture = MP_CreateTextureColor(256, 256, RGBA(0, 0, 255, 255))
sphere = MP_CreateSphere(30)
MP_EntitySetColor(sphere,RGB(0,255,0))
MP_EntitySetTexture(sphere, texture2)
MP_ScaleMesh(sphere,0.3,0.3,0.3)
cone = MP_CreateCone(64, 10)
MP_EntitySetTexture(cone, texture2)
MP_PositionEntity(cone, 0, 2, 0)
MP_ScaleMesh(cone, 0.5, 0.5, 0.5)
MP_RotateEntity(cone, 0, 90, 0)
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)
x.f : y.f = 2.5 :z.f
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
If MP_KeyDown(#PB_Key_Z)
y + 0.05
ElseIf MP_KeyDown(#PB_Key_X)
y - 0.05
EndIf
count.f + 1
x = Cos(Radian(count)) * 3: z = Sin(Radian(count)) * 3
MP_PositionEntity(light, x , y, z)
MP_PositionEntity(sphere, x , y, z)
MP_EntityLookAt(light,0,0,0)
MP_RenderWorld()
MP_Flip ()
Wend