Picking an object

Blitz3D Forums/Blitz3D Programming/Picking an object

Nexus6(Posted 2007) [#1]
Hi Guys
Im currently creating an editor and my problem is that I need to be able to pick an object (3D entity) and move it inside another object (3D entity), so far so good I’ve been able to do this, but if I want to return to this “embedded” object and move it again (I can see it because I have an alpha toggle button), I cant because its inside another object and is unpickable. I can’t hide the larger object because I need to place the second object in relation to it.

BTW you might be wondering why I want to place a 3d object within another object, well the object which is being embedded is just a visual representation for a point in 3d space, node/vector or whatever you want to call it.

Does anyone have any idea’s or solutions to. Thanks in advance.

Oh, and Happy New Year from all the staff at Nexus-6 Sentient Designs, which consists of :-

CEO – me
Head Programmer – me
Chief graphic artist – me
Apprentice – me
And a few other staff that I cant remember there names, but I think there called Me.


Matty(Posted 2007) [#2]
Can you use the cameraproject commands which allow you to convert an objects x/y/z coordinates into a 2d location on the screen.

something like:


cameraproject camera, insideobjectx,insideobjecty,insideobjectz
mx=mousex()
my=mousey()
if abs(mx-projectedx())<xscreentolerance and abs(my-projectedy())<yscreentolerance and projectedz()>0 then 
;we've put the mouse over the location of the insideobject without using the picking commands so it is quick although you may also need to check how far away any other objects are and whether they lie within a straight line of the camera and the object being tested.
endif 




Shambler(Posted 2007) [#3]
If you make the larger object unpickable and not an occluder then you should be able to pick the smaller one through it.


Nexus6(Posted 2007) [#4]
Thanks Guys, I'll try both methods when i get home from work tonight, and let you know the outcome.


jfk EO-11110(Posted 2007) [#5]
just an additional thought (do you watn to pick it using Camerapick or Linepick?)

If you have to pick both the inner and the outer mesh then you may use a homebrew multipick. Pick in the wanted direction. If it hits something, then do an additional pick from this picked location in the same direction. Repeat until nothing is picked anymore. Store the picking data in an array.


Nexus6(Posted 2007) [#6]
Thanks JFK, its camerapick im using and I only need to pick the inner mesh, Shamblers method of making the outer mesh unpickable seems to have done the trick.

Thanks again Guys.