Model elements pickable ? lazarus / 70-OpenGL ---------------------------------------------------------------------- scons · 2016-02-10 19:09 Hi I don't have the opengl option installed yet, but I was wondering if it is possible to pick elements from the 3d-model to give it another color, add some extra properties and then export the model attributes to a list to print ? Does the imported wrl-model keep all the attributes it had before it was imported ? Thanks ---------------------------------------------------------------------- User137 · 2016-02-10 23:56 I think the preferred way to mouse-pick something in 3D-space is to do some manual triangle math. Calculate a ray (straight line) from cursor position towards infinity, and find all the triangles that it intersects. Pick the intersect point closest to camera. If you want to study some existing source of nxPascal, here (also nxMath3D.pas): https://github.com/Zaflis/nxpascal/blob/master/src/nxModel.pas#L872 There are some ready demos too that use picking. I don't know what wrl format is, but OBJ file and few others split model's faces into groups. For most functions only triangles are valid. If they are polygons or quads, convert to tri first. ---------------------------------------------------------------------- scons · 2016-02-14 08:30 Ok thanks. Since I'm still a beginner, I will wait a few weeks before trying that I think, and keep practicing. But it's good to know it is possible ! ---------------------------------------------------------------------- BlueIcaro · 2016-02-14 21:33 Quote from: User137 on February 11, 2016, 12:56:39 amI think the preferred way to mouse-pick something in 3D-space is to do some manual triangle math. Calculate a ray (straight line) from cursor position towards infinity, and find all the triangles that it intersects. Pick the intersect point closest to camera. If you want to study some existing source of nxPascal, here (also nxMath3D.pas): https://github.com/Zaflis/nxpascal/blob/master/src/nxModel.pas#L872 There are some ready demos too that use picking. I don't know what wrl format is, but OBJ file and few others split model's faces into groups. For most functions only triangles are valid. If they are polygons or quads, convert to tri first. Hi, are you still working un nxpascal? ---------------------------------------------------------------------- User137 · 2016-02-18 23:26 Sadly i've not had time to. For game making i mostly moved to Unity. It's got so many features i couldn't even imagine making into engine. It is open source in github though, if someone wants to continue or help. ---------------------------------------------------------------------- Cyr · 2016-05-28 15:18 As for me the best decision was been the using of Castle Game Engine. It is very simple using of picking objects. https://github.com/castle- engine/castle-engine/blob/master/examples/3d_rendering_processing/list en_on_x3d_events.lpr - code for selecting object.