[osg-users] changing dimensions of a box
Robert Osfield
robert.osfield at gmail.com
Fri Jun 2 00:50:12 PDT 2017
HI Mat,
On 1 June 2017 at 16:42, Mat Monk <matthias-minki at web.de> wrote:
> As you said, I created a static box. But i dont understand the shaders function in the example osgshaders.
I guess you must be learning OpenGL/OpenGL Shaders as well as OSG then.
> I found a example of a rotating quad and modified it, so it includes my box instead the quad. But finally i couldn't change the rotation to changing the dimensions in x-direction for examples.
Using callbacks to update the vertices is one possible solution, but
the most heavy-wieght in terms of CPU cost.
If you want to modify the vertices of the geoemtry using a callback
then you've done most of the required steps. The only thing missing
is that you have to iterate over all the vertices in the Vec3Array.
Vec3Array is std::vector<osg::Vec3> under the hood so knowledge of
Standard C++ should help here. Also look at the include/osg/Vec3f
class to see what maths methods are available.
Robert.
More information about the osg-users
mailing list