OpenGL Gadget: How to make mesh edges more defined?

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: OpenGL Gadget: How to make mesh edges more defined?

Post by Samuel »

I'd go with ray triangle intersection for mouse picking. There are other methods like using a "color" buffer, but I'm not very fond of them because of the lack of speed with glReadPixels(). Ray triangle picking(if optimized properly) is faster and there are more things you can do with it.

Here's a nice article that uses ray triangle intersection for some ray tracing if you're interested. https://www.scratchapixel.com/lessons/3 ... c-solution
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: OpenGL Gadget: How to make mesh edges more defined?

Post by IdeasVacuum »

.... That is a nice article. I will study it carefully, but I notice in the description a kind of chicken and egg situation when testing to see if "the" triangle face is hit, parallel to the ray or behind the ray - in real time, that's thousands of triangles tested to find "the" triangle.

Edit: ...and the User pick could be a vertex point :)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: OpenGL Gadget: How to make mesh edges more defined?

Post by Samuel »

There needs to be optimizations for real time use. Without an acceleration structure (Octrees, BSD trees, K-d trees, etc...) it isn't really usable for real time. Add in multi threading with that and you end up with a very fast system. Even in cases where there are millions of polygons.

For vertex points I'd use ray sphere intersection instead.
https://www.scratchapixel.com/lessons/3 ... tersection
Post Reply