NVPR Cursive Text Sample
Description
This sample demonstrates how to use NV_path_rendering to animate the dash pattern of a stroked path, as a way to simulate live cursive writing.
APIs Used
- NV_path_rendering
- EXT_direct_state_access
Shared User Interface
The Graphics samples all share a common app framework and certain user interface elements, centered around the "Tweakbar" panel on the left side of the screen which lets you interactively control certain variables in each sample.
To show and hide the Tweakbar, simply click or touch the triangular button positioned in the top-left of the view.
Technical Details
An outline for the text "This is crazy" is drawn incrementally by computing the total arc length of the path using glGetPathLengthNV
and then setting the dash pattern with glPathDashArrayNV
to be some percentage of that total path length. By animating the dash pattern in this way, the stroking of the path appears to animate in way to trace out the path's outline.