Implementing VectorUtil.isInTriangleVec3()

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Implementing VectorUtil.isInTriangleVec3()

ericg
Hello,  I am interested in using the function isInTriangleVec3() from the VectorUtil library but I can't find any documentation on how to use it.  The closest I found was vertexInTriangle() but it is missing parameters ac, ab and ap.  What I have is this:

    public static boolean isInTriangleVec3(final float[] a, final float[] b, final float[] c,
                                                           final float[] p,final float[] ac, final float[] ab,
                                                           final float[] ap)

I assume a, b and c are the 3 vertices of the current triangle. 'p' is the vertex that I am testing.  What are ac, ab and ap?
Reply | Threaded
Open this post in threaded view
|

Re: Implementing VectorUtil.isInTriangleVec3()

gouessej
Administrator
Hi

This method is partially documented and I remind you that JOGL is open source. Then, the best way to know how it works consists in ... looking at its source code, doesn't it?

https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java#L720

ac, ab and ap represent the vectors formed by the vertices a and c (ac), a and b (ab) and a and p (ap). You can pass whatever you want as they are output parameters.

Feel free to improve the documentation. A git pull request would be welcome.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Implementing VectorUtil.isInTriangleVec3()

ericg
Thanks for the link, I should have thought to look at the github document.  A google search on VectorUtil brings up what I guess is an older javadoc for that library. (I'm not even going to ask what a 'git pull request' is! - I'll find out...)
Reply | Threaded
Open this post in threaded view
|

Re: Implementing VectorUtil.isInTriangleVec3()

gouessej
Administrator
I posted two links including one pointing out to the latest documentation, there is no need of a search engine to find it. GIT is a revision control system and I suggested you to contribute, that's why I talked about doing a pull request.
Julien Gouesse | Personal blog | Website