# Is there a simple way to check if a point is contained in an 3D Object?

Hello,

I am fairly new to OpenGL and currently developing on a modelling platform which has OpenGL integrated. My current task is to implement a selection for different usecases (rectangular, curcular, planar, etc.).
So far I create an 3D object and place it in position for all points (nodes) that should be included. Then the points are checked, based on their position in x, y & z if they have a shorter distance from the middle point of a sphere to its radius, or on which side of the plane it is positioned based on the normal vector - analog for a cube.

However, my supervisor is not pleased with the approach. So I have been searching through the api, this forum and google for any hint or a functional that checks if a point is in ‘hitbox’ or volume. So far I have only found the following thread: “How to know if point is inside a volume?”
I wonder what it means to ’ test each vertex in all 6 directions’, but that is what i am actually doing with the radius for a sphere or 6 planes of a cube. And how the reduction to an convex shape would be helpful? Are there more keywords I can look for? Otherwise, if one has a direct explanation or link, that would really help me out!

OpenGL’s job is to give you access to GPU hardware for rendering primitives. Tests for whether a point is inside some geometry is not OpenGL’s job. So there are no functions for doing that.

There are lots of ways to do point-in-object tests, depending on the nature of the object.

That is good to know, so I can leave that behind me. I’ll focus my research on that. thank you for your reply.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.