www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: ErDetEnAnd? on May 19, 2008, 06:04:56 pm

Title: Mouse selection using vertex information
Post by: ErDetEnAnd? on May 19, 2008, 06:04:56 pm
Hello.

How do I access the transformed vertex information? I understand a IVertexController implementation operates in object space, but could it somehow work in the world? The PolygonManager delivers the transformed vertex, but it assumes that one is operating on polygons. I wouldn't expect the PolygonManager is the obviously choise for this kind of job - the current approach would then give 3x CPU overhead (for triangles).

By custom selection the transformed mesh should be directly accessible, but I can't figure out how...

Thanks in advance!
Title: Re: Mouse selection using vertex information
Post by: EgonOlsen on May 19, 2008, 06:30:17 pm
You can get the current world transformation from an object and use that in the vertex controller to calculate the vertex in world space (vertex.matMal(obj.getWorldTransformation())).
Title: Re: Mouse selection using vertex information
Post by: ErDetEnAnd? on May 19, 2008, 07:50:44 pm
Thank you for your fast reply - that's excellent.