Login  Register

Re: GPU based Resolution Independent Curve Rendering

Posted by Rami Santina on Apr 06, 2011; 10:31am
URL: https://forum.jogamp.org/GPU-based-Resolution-Independent-Curve-Rendering-tp2764277p2784455.html

>>In my case, the map is not an image, it is often very irregular, it could not be put into a texture.

Perfect, which makes a great use case to the region renderer (is it coming in an SVG like file, stream,...etc)

You can create an  an com.jogamp.graph.curve.OutlineShape  from the data
and render it with
com.jogamp.graph.curve.opengl.RegionRenderer.renderOutlineShape(...);

>>I need to display some text exactly on these contours, like isobars in meteorology 
was planning to add this to the API soon, but now that you have a usecase for it, maybe we can discuss it here first...
Already added a Quaternion impl to the code base which would be the keystone to this feature.

This is basically a path animation problem, which Quaternion is, in my opinion, the best solution for it.

So as to how to render the text on the curve, (glyphs rotating along it)

We would define a start and end rotation (using quaternion) to the first glyph and the last...and any glyph in the middle (optional)
and then we would slerp between to get an interpolation between the glyphs.

This would be like Local rotation instead of the global rotation (.rotate(...) ).
In path aniamtion, you would define these quaternions on the curve it self, and when the text or object moves it get influenced by the relevant quaternions.

So how to define it from a user perspective,

my guess,
glyphString.addRotationVector(float[] upvector, float[] right); (right vector needed to know the orientation if in 3D space)

upvector - since we can create the quaternion from it internally (so a user doesnt need to understand/create quaternions)

the first rotation vector added is for the first glyph, and the last for the last...and the middle get specified as constraints.
in your case the param upvector would be the up vec at the ISO at that position.

things we would need to consider is what to do with nonRenderable glyphs (like spaces..)
 Skip in computation  or assume they are there!

what do you think? 

Cheers
Rami