Hi Eric, Like Paul and John I'd suggest consider using a vertex program to combine separate vertex attribute arrays into a single vec3 and then do the transform.
There are downsides to this though, it does mean that things like CPU intersection testing won't have the data in a good form. Potentially you could write your own osg::Drawable that does a CPU combining of the array data on demand via a using Drawable::accept(PrimitiveFunctor&) method. Thinking about this is probably how I'd tackle it, have a complete fresh custom drawable entirely dedicated to this custom task. Robert. On 11/28/06, E. Wing <[EMAIL PROTECTED]> wrote:
I'm using osg as a plotting system to plot data points to the screen quickly. I have been putting osg::Vec3 points in osg::Vec3Arrays and using osg::Geometry to draw points, lines, etc. The code I'm integrating with likes to keep data on each axis separate. Specifically, X and Y data points are kept in separate C arrays. Currently, I do my own data copies to combine the X-Y points (and add a fake Z) to build up a Vec3Array. This is not exactly the speediest thing, so I'm wondering if there is something in OpenGL or OSG that lets me keep separate arrays for each axis. To further impact things, it is possible that I might have to do a non-linear transform on just one axis (e.g. turn the X-axis to log10 scale). I have been throwing away my original axis only copy of the data to save memory (though maybe I shouldn't). So I would have to loop through my Vec3Array and transform just the x components. There are low-level APIs available to me that do fast math operations, but I don't thnk they work on interleaved data structures like this (assume a primitive array of data). I'm wondering if anybody has any thoughts/recommendations on how I might better approach this? Thanks, Eric _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
