First, sorry Jan!
I'm new to mailing lists and assumed that threads were generated on the
basis of the subject line not who I replied to. Thanks for pointing out
my mistake.
Second, thanks to Tanguy and Ralph for suggestions.
I'm using an old 2.8 Ghz Pentium 4 - so not a dual core problem. But the
error does remind me of threading issues I used to have with
multiprocessor IRIX machines.
I tried using the volatile type qualifier but then I got a load of
conversion errors because MSVC++ v9 didn't recognise the variable as an
osg::Vec3 anymore:
.\dodec.cpp(78) : error C2678: binary '-' : no operator found which
takes a left-hand operand of type 'volatile osg::Vec3' (or there is no
acceptable conversion)
C:\Program Files\OpenSceneGraph\include\osg/Vec3f(152): could be
'const osg::Vec3f osg::Vec3f::operator -(const osg::Vec3f &) const'
C:\Program Files\OpenSceneGraph\include\osg/Vec3f(167): or
'const osg::Vec3f osg::Vec3f::operator -(void) const'
I've distilled the problem into a pretty simple program - I don't even
need to pop up a window. Some things might look a little odd, but almost
any changes from this point result in correct behaviour. I'm expecting a
list of coordinates from (0.0, 0.0, 0.0) to (11.0, 11.0, 11.0) but as
you'll hopefully see, I get the central part of the array not updating
properly.
#include <osg/Geometry>
osg::Vec3 vc[12];
int main( int argc, char **argv )
{
int a;
osg::Vec3 vt[12], p;
for(a=0;a<12;a++){
vc[a].set((float)a, (float)a, (float)a+1.0f);
}
p = osg::Vec3(0.0f,0.0f,1.0f);
vt[0] = vc[0]-p;
for(a=1;a<12;a++){
vt[a] = vc[a]-p;
}
for(a=0;a<12;a++){
printf("%5.2f %5.2f %5.2f\n", vt[a].x(), vt[a].y(),
vt[a].z());
}
return 0;
}
Two crucial steps are the vc[a]-p stage, and using the local variable vt
for printing because otherwise the array updates correctly.
Any ideas? Such as leave it for Microsoft to sort out!
Thanks,
Guy
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org