is there a way to make a 2d image (e.g. a cursor) and use it to "click" on a 3d object, such as a cube?
. .
Blitz3D Forums/Blitz3D Beginners Area/. . Look at the camerapick commands in the command reference, passing it the camera, mouse x() and mouse y() values, make sure the object you wish to select is pickable with per polygon picking specified.
could you show me an exmple? ive never tried this before.
would this be right?
would this be right?
camera=createcamera() circlex = mousex() circley=mousey() cube= createcube() CameraPick ( camera,circlex,circley ) If EntityPick(cube,10) Then End EndIf
close but not quite right...don't have b3d in front of me right now but it should go something like this:
something like that should work
graphics3d 800,600,0,2 camera=createcamera() cube=createcube() entitypickmode cube,2 ;sets per polygon picking moveentity camera,0,0,-10 ;move the camera back so it can see the cube repeat mx=mousex() my=mousey() updateworld renderworld if camerapick(camera,mx,my)<>0 then color 255,255,255 text 0,0,"You put the mouse cursor over the cube" else color 255,255,255 text 0,0,"Mouse cursor not over anything" endif flip until keydown(1) end
something like that should work
wow your good. spot on! txs ^^