[osg-users] Geometry of Generic 3D Surface from Collection of Points
Robert Osfield
robert.osfield at gmail.com
Mon Aug 17 07:18:50 PDT 2015
Hi Erik,
On 17 August 2015 at 14:44, Erik Hensens <ehensens at hunter.com> wrote:
> Sorry but could you expand just a little bit on what you mean by "For
> instance if you had a data set that has two input variables that specify a
> surface in 3D then you could create a regular tessellation in the 2D input
> space then map the 2D coordinates to their final 3D coordinates - think of
> table cloth with a regular grid that you then scrunch up." In particular,
> what do you mean by 'map the 2D coordinates to their final 3D coordinates'?
>
> Sorry and thanks very much for your patience... :-*
>
I don't know what part needs clarifying.
There are OSG examples like osggeometry that illustrate creating
osg::Geometry to represent points, lines and meshes by specifying the raw
3D coordinates, normals, texcoords and meshes.
The osganimation example creates a mesh with a regular grid like a chess
board.
The osgdalunay and osgtesselate illustrate how to use the
osgUtil::DelanayTriangulator and osgUtil::Tessellator respectively.
The osgshaderterrain creates a flat grid and then uses a vertex shader that
reads a texture for a height field and then modifies the flat geometry to
produce the final deformed mesh. This function only modifies the Z value
using the height field, but it's possible to modify all coordinates if you
so wish, i.e. use a vec3 vertex = myfunction( vec2(x,y) );
You could do something similar to the original mesh coordinates in C++
rather than shaders.
All these possibilities mean there might be plenty of ways to do what you
need to do, but it may also be that your particular problem domain isn't
amenable to these approaches. You've never really said exactly what type
of data you have to work with so it really isn't possible to tell you
exactly what to do.
Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150817/9e0a0d97/attachment-0003.htm>
More information about the osg-users
mailing list