Hi Michael
you have pushed plotting facilities of your engine to the extreme, from dynamically normal points to thick point and then textured points, treated as a whole one collection.
i have tried your advise, but i may not applied it correctly:
i can see the points textured correctly when we zoom to it, but i have ambiquity regarding the blending source and destination, my source is a blue or white circle bounded by transparent boundary
Circle_Blue....
Circle_White....
i have used MP_PrimitivesBlendingMode (Entity, 5, 3 ) , i see that the circle boundary are transparent but still the blue have semi transparency. any advice here ??.
when i choose :
NumOfPoints = 3.14159*2 / 0.003
For PointNumber = 0 To NumOfPoints
t.f+0.003
instead of :
NumOfPoints = 3.14159*2 / 0.05
For PointNumber = 0 To NumOfPoints
t.f+0.05
i see a perfect tube, that is very great, but the color are moving through the tube, possibly depends on the GPU card and due to the huge task over the GPU in calculating 2094 textured big points at the same time.
big thanks Michael, i hope the educational, schools, labs, etc be aware of the plotting facilities of this Libary together with PureBasic in math and art.
Code: Select all
Global xres=640, yres=480
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "3D Knot, press space key to stop rotation, press Z, X keys to zoom in/out")
; Background
If CreateImage(0, 256, 256,32)
;MP_CreateImageColored(0, 0, #Yellow,#Yellow,#Red,#Green)
MP_CreateImageColored(0, 0, #Yellow,#White,#Red,#Green)
Surface = MP_ImageToSurface(0)
FreeImage(0)
MP_SurfaceSetPosition(Surface,0,0,1)
MP_SurfaceDestRect(Surface,0, 0, xres, yres)
EndIf
camera=MP_CreateCamera()
light=MP_CreateLight(2)
MP_LightSetColor (light, RGB(255,255,255))
MP_PositionCamera(camera, 0, 5, 10)
MP_CameraLookAt(camera,0,0,0)
MP_PositionEntity(light, 0, 10, 20)
MP_EntityLookAt(light,0,0,0)
Global Entity= MP_CreatePrimitives (1000000, 7)
Global.f x, y, z
Define.l red, green, blue
Quit.b = #False
textur = MP_LoadTexture("circle.png", 1)
;==============================================================
red = 255: green = 255: blue = 255
pointSize.f=1
NumOfPoints = 3.14159*2 / 0.05
For PointNumber = 0 To NumOfPoints
t.f+0.05
x = Cos(t) + 1.5*Cos(-2*t)
y = Sin(t) + 1.5*Sin(-2*t)
;z = 0.35 * Sin(3*t)
z = 1 * Sin(3*t)
;MP_SetPrimitives(Entity, PointNumber, x, y, z, textur ,0.001)
MP_SetPrimitives(Entity, PointNumber, x, y, z, MP_ARGB(0,255,255,255), 0.04 )
Next
MP_EntitySetTexture(Entity,textur)
MP_PrimitivesBlendingMode (Entity, 5, 3 )
MP_ScaleEntity(Entity, 1.5, 1.5, 1.5)
MP_PositionCamera(camera, 0, 0, 10)
MP_CameraLookAt(camera,0,0,0)
MP_PositionEntity(light, 0 , 0, 10)
MP_EntityLookAt(light,0,0,0)
xx.f=0 :zz.f=0 : turn.b = 0: rot.f=0.5
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
If MP_KeyDown(#PB_Key_Z)
;xx.f + 0.1
zz.f + 0.1
ElseIf MP_KeyDown(#PB_Key_X)
;xx.f - 0.1
zz.f - 0.1
ElseIf MP_KeyHit(#PB_Key_Space)
If turn
rot=0.5
Else
rot=0
EndIf
turn ! 1
EndIf
MP_PositionEntity(Entity, xx, 0, zz)
MP_TurnEntity(Entity,0,rot,0)
MP_RenderWorld()
MP_Flip ()
Wend