In its current form the example name above is not animated. Here is a
simple patch that updates the time inputs correctly.
-D
--
Daniel E. Shipton
Software Engineer, Infiscape Corp.
Index: 29FBOTexture.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Tutorials/29FBOTexture.cpp,v
retrieving revision 1.2
diff -u -r1.2 29FBOTexture.cpp
--- 29FBOTexture.cpp 25 Jun 2007 09:49:48 -0000 1.2
+++ 29FBOTexture.cpp 1 Aug 2007 15:38:32 -0000
@@ -49,8 +49,8 @@
// forward declarations
Matrix showAll(NodePtr root, PerspectiveCameraPtr cam);
-void animateFlag(Real32 t);
-void spinFBOScene(Real32 t);
+void animateFlag(Real64 t);
+void spinFBOScene(Real64 t);
SimpleTexturedMaterialPtr createWoodMaterial();
NodePtr buildFlag(TextureChunkPtr fboTexture, const int &flagHor, const int &flagVert);
NodePtr buildFBOScene(int argc, char **argv );
@@ -59,8 +59,10 @@
// redraw the window
void display(void)
{
+ static Real64 t0 = OSG::getSystemTime();
+
// get the current time
- Real32 t = OSG::getTimeStampMsecs(OSG::getTimeStamp()) * 0.001f;
+ Real64 t = OSG::getSystemTime() - t0;
// animate flag
animateFlag(t);
@@ -225,7 +227,7 @@
return m;
}
-void animateFlag( Real32 t )
+void animateFlag( Real64 t )
{
// get positions
GeoPositions3fPtr pos = GeoPositions3fPtr::dcast(::flagGeo->getPositions());
@@ -249,7 +251,7 @@
calcVertexNormals(::flagGeo);
}
-void spinFBOScene( Real32 t )
+void spinFBOScene( Real64 t )
{
beginEditCP(::fboSceneTrans, Transform::MatrixFieldMask);
Matrix m;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users