|
From: Keith W. <kw...@cs...> - 2004-06-15 01:19:38
|
I am doing a simple texture "animation" by scrolling the UV coordinates
of a texture, exactly as per the Nanosaur public code. I got it to work
without a problem, except there's a problem. I have a couple models in
the world right now. It's a test world so it's not very interesting,
just a place to screw around. The texture and object in question
animate perfectly, a really cheap looking waterfall which I will make
fancier when the time comes. Here's the thing. Some of the other
objects in the world are displaying texture scrolling as well, but yet
some other objects aren't. I didn't want anything to scroll that I
don't explicitly designate as such of course. I can't figure out why
some unintended objects and textures are scrolling while others remain
normal.
Bear in mind that each of these objects came from a separate 3DMF file
with its own texture and basically totally separate from all the other
models in every way I can imagine.
What could possibly cause this? Here's my code. It's ridiculously
simple, because as far as I can tell, scrolling the texture isn't very
hard. (This code is written with the Queeg framework, with necessary
accessors added to the associated classes, and the function below is
called from the Queeg Update function).
Any help appreciated. Thanks.
void AnimateWaterfallTexture()
{
TQ3Matrix3x3 uvTransformMatrix;
Q3Matrix3x3_SetTranslate(&uvTransformMatrix, gH, gV);
gH += 0;
gV -= .003;
QGTriMesh* triMesh = gWaterfall->GetFirstTriMesh();
TQ3TriMeshData triMeshData;
triMeshData = triMesh->GetTriMeshData();
TQ3SurfaceShaderObject shader;
if (triMeshData.triMeshAttributeSet)
{
if (Q3AttributeSet_Contains(triMeshData.triMeshAttributeSet,
kQ3AttributeTypeSurfaceShader))
{
Q3AttributeSet_Get(triMeshData.triMeshAttributeSet,
kQ3AttributeTypeSurfaceShader, &shader);
Q3Shader_SetUVTransform(shader, &uvTransformMatrix);
Q3Object_Dispose(shader);
}
}
}
________________________________________________________________________
Keith Wiley kw...@cs...
http://www.unm.edu/~keithw http://www.mp3.com/KeithWiley
"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
-- Edwin A. Abbott, Flatland
________________________________________________________________________
|