# hitTest

**URL:** <https://community.khronos.org/t/hittest/50197>\
**Category:** OpenGL\
**Created:** [October 9, 2002, 10:34am UTC](https://community.khronos.org/t/hittest/50197 "2002-10-09T10:34:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 9, 2002, 10:34am UTC](https://community.khronos.org/t/hittest/50197/1 "2002-10-09T10:34:00Z")

</div>

I think openGl should have some kind of library that would at least help doing non-sphirical hittesting. HitTseting of obj vs obj is what I would like to see in next version to be easier to accomplish

---

<div class="post-metadata">

**Author:** ![vincoof](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/ec9cab/32.png) [@vincoof](https://community.khronos.org/u/vincoof)\
**Post date:** [October 14, 2002, 12:45am UTC](https://community.khronos.org/t/hittest/50197/2 "2002-10-14T00:45:00Z")

</div>

Again, OpenGL is a low-level API.  
There is no concept of ‘object’ under OpenGL, so there can not be a concept of hit-test between objects. At best there would be hit test between polygons, and that would be up to you to organize polygons so that they represents objects (in other words, it’s up to you to build or use a higher level API that encapsulates low-level OpenGL functionalities)

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 21, 2002, 2:40pm UTC](https://community.khronos.org/t/hittest/50197/3 "2002-10-21T14:40:00Z")

</div>

ya ,ya I know but what i meant by obj is a file with an .obj file extention

---

<div class="post-metadata">

**Author:** ![Korval](https://community.khronos.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Korval](https://community.khronos.org/u/Korval)\
**Post date:** [October 21, 2002, 3:16pm UTC](https://community.khronos.org/t/hittest/50197/4 "2002-10-21T15:16:00Z")

</div>

> ya ,ya I know but what i meant by obj is a file with an .obj file extention

OpenGL has/needs no concept of files, extensions, or objects.

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 23, 2002, 9:43am UTC](https://community.khronos.org/t/hittest/50197/5 "2002-10-23T09:43:00Z")

</div>

Yes it does. Current openGL is to basic it sould have a higher level functions. It should promote organization of NURBS and polygons in to objects.

---

<div class="post-metadata">

**Author:** ![vincoof](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/ec9cab/32.png) [@vincoof](https://community.khronos.org/u/vincoof)\
**Post date:** [October 24, 2002, 8:25am UTC](https://community.khronos.org/t/hittest/50197/6 "2002-10-24T08:25:00Z")

</div>

No it should not. At least not now.  
OpenGL2.0 will provide such features but it’s not the goal of OpenGL1.x

---

<div class="post-metadata">

**Author:** ![Korval](https://community.khronos.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Korval](https://community.khronos.org/u/Korval)\
**Post date:** [October 24, 2002, 9:18am UTC](https://community.khronos.org/t/hittest/50197/7 "2002-10-24T09:18:00Z")

</div>

OpenGL (2.0 or 1.x) is not designed as a scene graph API. The concept of objects is not something that it should even be concerned with. GL is just fine being what it is: a rendering API that works relatively well with hardware.

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 24, 2002, 10:00am UTC](https://community.khronos.org/t/hittest/50197/8 "2002-10-24T10:00:00Z")

</div>

> Originally posted by vincoof:  
> No it should not. At least not now.  
> OpenGL2.0 will provide such features but it’s not the goal of OpenGL1.x

Why shouldn’t it be the goal of openGL 1.x why wait for openGL 2.0  
Objects would be easier to deal with and it will be easier to hitTest one against the other. Not just polygon vs polygon or sphere hittesting but and object on object hitTesting. It would at lwast save me a lot of work. I am trying to make my own library that will organize polygons in to objects. I won’t wait till openGl 2.0 . I still have problems with hitTesting though

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 24, 2002, 10:01am UTC](https://community.khronos.org/t/hittest/50197/9 "2002-10-24T10:01:00Z")

</div>

whats the difference between frequent contributor and just contributor?

---

<div class="post-metadata">

**Author:** ![vincoof](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/ec9cab/32.png) [@vincoof](https://community.khronos.org/u/vincoof)\
**Post date:** [October 25, 2002, 12:27am UTC](https://community.khronos.org/t/hittest/50197/10 "2002-10-25T00:27:00Z")

</div>

If you want higher-level APIs, there already exist some which use OpenGL - glut, glaux, glow and more. OpenGL is designed to be low-level. This way, higher-level APIs have more freedom.

---

<div class="post-metadata">

**Author:** ![vincoof](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/ec9cab/32.png) [@vincoof](https://community.khronos.org/u/vincoof)\
**Post date:** [October 25, 2002, 12:45am UTC](https://community.khronos.org/t/hittest/50197/11 "2002-10-25T00:45:00Z")

</div>

Frequent contributors are contributors who had posted a “certain ammount of messages”. It’s useful to see who is new to the site and who is not, though it’s not such a good analysis.

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 25, 2002, 12:12pm UTC](https://community.khronos.org/t/hittest/50197/12 "2002-10-25T12:12:00Z")

</div>

I know, I am using glut but it still a very low level.

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 28, 2002, 12:07pm UTC](https://community.khronos.org/t/hittest/50197/13 "2002-10-28T12:07:00Z")

</div>

Can anyone suggest to me how to do polygon hittesting (not sphirical)?

---

<div class="post-metadata">

**Author:** ![\_Aaron](https://community.khronos.org/letter_avatar_proxy/v4/letter/_/5fc32e/32.png) [@\_Aaron](https://community.khronos.org/u/_Aaron)\
**Post date:** [October 28, 2002, 4:50pm UTC](https://community.khronos.org/t/hittest/50197/14 "2002-10-28T16:50:00Z")

</div>

First, GLUT is not a scene graph! It is “a window system independent toolkit for writing OpenGL programs” that “implements a simple windowing application programming interface (API) for OpenGL.”

Second, OpenGL is what it is. If it isn’t high-level enough for you, then go find a software library that has objects, file loading, hit testing, etc. I think a game engine is probably what you’re looking for.

OpenGL drivers are buggy enough as it is. If OpenGL were made into a high-level game engine (which is what you seem to be proposing), and the entire library were rewritten by every hardware vender, developing applications for OpenGL that ran on most platforms would be a real pain. It’s best to keep higher-level features centralized in one code base, and leave the low-level stuff to the hardware venders.

More importantly, this kind of software already exists. Every other day there’s a new 3d game engine announced on the main page. Don’t you think it would be easier to use one of these than to convince the ARB to change the whole direction of OpenGL?

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [October 29, 2002, 1:41pm UTC](https://community.khronos.org/t/hittest/50197/15 "2002-10-29T13:41:00Z")

</div>

Where can I find one of your “game engines” for free? are there any for free?

---

<div class="post-metadata">

**Author:** ![Bob](https://community.khronos.org/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@Bob](https://community.khronos.org/u/Bob)\
**Post date:** [October 29, 2002, 2:33pm UTC](https://community.khronos.org/t/hittest/50197/16 "2002-10-29T14:33:00Z")

</div>

I gave you two links in the “BSP in display lists” thread.

---

<div class="post-metadata">

**Author:** ![vladk](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/cdc98d/32.png) [@vladk](https://community.khronos.org/u/vladk)\
**Post date:** [November 4, 2002, 8:27pm UTC](https://community.khronos.org/t/hittest/50197/17 "2002-11-04T20:27:00Z")

</div>

> Originally posted by valmian:  
> Can anyone suggest to me how to do polygon hittesting (not sphirical)?

The hittesting is very application specific. It depends on what are your objects, what is their geometry. For example, your sphere has 700 polygons, and it has to move about a world with +5000 polygons. How fast you think you can have your engine if it were to test each of sphere.700 polygons against world.5000 polygons?

In this case, you can use angle/radius combination to calculate wether the sphere _entered_ an object (not a polygon but another object).

Having more complex objects demands complex algorithms, but it can all be optimized.

Fake it 'till you make it!

Therefore, there is NO generic way to calculate hittest. It depends on object geometry, and in order for OpenGL to understand an “object” it would have to be something similar to a neural network that, by experience, learns how each object performs. It would also need a high-order persistent memory that actually does the learning. It would also need to know how specific objects move in space, so you would have to teach it some basic physics…  
When I mean “teach” I don’t mean hardware implementation, but real-time learning of your OpenGL renderer… in which case you will have to keep your computer turned on forever, or use some hologramic memory…  
 ![](http://www.opengl.org/discussion_boards/ubb/smile.gif))

---

<div class="post-metadata">

**Author:** ![valmian](https://community.khronos.org/letter_avatar_proxy/v4/letter/v/e47c2d/32.png) [@valmian](https://community.khronos.org/u/valmian)\
**Post date:** [November 5, 2002, 12:17pm UTC](https://community.khronos.org/t/hittest/50197/18 "2002-11-05T12:17:00Z")

</div>

Ya ya watever, I know how to do sphirical my self

---

<div class="post-metadata">

**Author:** ![nigels](https://community.khronos.org/user_avatar/community.khronos.org/nigels/32/50_2.png) [@nigels](https://community.khronos.org/u/nigels)\
**Post date:** [November 23, 2002, 3:59pm UTC](https://community.khronos.org/t/hittest/50197/19 "2002-11-23T15:59:00Z")

</div>

Valmian, are you talking about  
intersection detection?

What does that have to do with rendering?

OpenGL is an API for real-time 3D rendering,  
not a solution for all 3D graphics problems.

---

<div class="post-metadata">

**Author:** ![zeckensack](https://community.khronos.org/letter_avatar_proxy/v4/letter/z/7ab992/32.png) [@zeckensack](https://community.khronos.org/u/zeckensack)\
**Post date:** [November 24, 2002, 12:38am UTC](https://community.khronos.org/t/hittest/50197/20 "2002-11-24T00:38:00Z")

</div>

Waiter!  
Can we get some non-pointless threads in here?

[Next page](https://community.khronos.org/t/hittest/50197.md?page=2)
