loopbio / FreemooVR

A standalone, hackable, versatile, composable, perspective-correct VR for freely moving animals engine
Other
1 stars 1 forks source link

improve coordinate transforms for arbitrarygeometry #2

Open ap-- opened 5 years ago

ap-- commented 5 years ago

https://github.com/loopbio/FreemooVRPrivate/blob/e05ce8ab869bbda1a8bc46c8e561da98b0283bec/src/DisplaySurfaceArbitraryGeometry.cpp#L213-L238

I believe this part of the ArbitraryGeometry code should be rewritten.

  1. For the UV -> XYZ path, we should just probe vertically down. This should speed up uv2xyz calls by quite a bit
  2. To improve the XYZ -> UV path and not return NaNs as often, we should use a custom osgUtil::PolytopeIntersector instead of the line intersectors in all directions, and implement finding the closest point if the polytope intersects.