i dont understand the problem with these code?
if the mouse is on the object it picked it correct...

Greetings Michael
lbry.tv/20220919:b
Code: Select all
WindowWidth.u=640:WindowHeigh.u=480
MP_Graphics3D(WindowWidth,WindowHeigh,0,2)
light.i=MP_CreateLight(1)
ViewPortX2.f=400:ViewPortY2.f=80:ViewPortWidth2.f=200:ViewPortHeigh2.f=300
cam2.i=MP_CreateCamera()
ViewPort2.i=MP_CameraViewPort(cam2,ViewPortX2,ViewPortY2,ViewPortWidth2,ViewPortHeigh2,$00346B0A)
MP_CameraSetPerspective(cam2,45,ViewPortWidth2/ViewPortHeigh2)
m2.i=MP_CreateCube()
MP_EntitySetZ(m2,-1000)
MP_PositionEntity(cam2,0,0,-995)
MP_PointEntity(cam2,m2)
While WindowEvent()<>#PB_Event_CloseWindow
mdx.f=MP_MouseDeltaX()/200:mdy.f=MP_MouseDeltaY()/200:mdw.f=MP_MouseDeltaWheel()/400
picked.i=MP_PickCamera(cam2,WindowMouseX(0),WindowMouseY(0))
MP_DrawText(400,80,Hex(picked)+" found. Distance: "+StrF(MP_PickedGetDistance(),4))
MP_TurnEntity(m2,0.3,-0.23,-0.1)
MP_RenderWorld()
MP_Flip()
Debug MP_VSyncTime()
Wend
0.19587050378323
0.03500290215015
0.01799930073321
0.01500369980931
0.01699990034103
0.01601699925959
0.0159818995744
0.01702049933374
0.01698219962418
0.01600160077214
0.01700320094824
0.01799790002406
0.01601600088179
0.0160044003278
0.01698550023139
0.01699990034103
0.01599970087409
...
it would be interesting to add a tool like Imgui or noesisengine gui as system GUI.mpz wrote: Sat Jan 14, 2023 4:23 pm Hi,
i dont have any code ready for now. Do anybody a opengl example for these?
It is possible to include these, but it is easier if anybody has a example code...
Greetings Michael