Hi,
How can be sur the command "dbSetEffectConstantMatrix" sent really the matrix with the values in the shader?
Because I think dbSetEffectConstantMatrix seems to be sending constant value 0
Ps: the shader and code work with GDK 1.0
But maybe it's me, who don't understand the new matrix Structure
//Vector
Vector4 vec100;
Matrix4 mat1;
Matrix4 mat2;
Matrix4 mat3;
Matrix4 mat4;
dbRotateXMatrix4( &mat1,-dbWrapValue(dbObjectAngleX(Obj))*0.0174532778f);
dbRotateYMatrix4( &mat2,-dbWrapValue(dbObjectAngleY(Obj))*0.0174532778f);
dbRotateZMatrix4( &mat3,-dbWrapValue(dbObjectAngleZ(Obj))*0.0174532778f);
dbMultiplyMatrix4 ( &mat4,&mat1,&mat2 );
dbMultiplyMatrix4 ( &mat4,&mat4,&mat3 );
dbScaleMatrix4( &mat1,dbObjectSizeX(Obj,1)/dbObjectSizeX(Obj),dbObjectSizeY(Obj,1)/dbObjectSizeY(Obj),dbObjectSizeZ(Obj,1)/dbObjectSizeZ(Obj));
dbMultiplyMatrix4( &mat4,&mat4,&mat1 );
dbTransposeMatrix4( &mat4,&mat4 );
dbTranslateMatrix4( &mat1, dbObjectPositionX(Obj),dbObjectPositionY(Obj),dbObjectPositionZ(Obj) );
dbMultiplyMatrix4( &mat4,&mat4,&mat1 );
dbViewMatrix4( &mat1 );
dbMultiplyMatrix4( &mat4,&mat4,&mat1 );
dbProjectionMatrix4( &mat1 );
dbMultiplyMatrix4( &mat4,&mat4,&mat1 );
dbSetEffectConstantMatrix( Eff,"PreviousWVP",&mat4 );
EDIT1:
If i fix a random value in the Fx file like this:
matrix PreviousWVP={
.299f,.857f,.144f,0,
.299f,.857f,.144f,0,
.299f,.857f,.144f,0,
0,0,0,1 };
and I comment the command
"dbSetEffectConstantMatrix( Eff,"PreviousWVP",&mat1 )"
the shader matrix value are OK, but if I uncomment ""dbSetEffectConstantMatrix( Eff,"PreviousWVP",&mat1 )"
the matrix Value are {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} but before the command in Debug mode in GDK with Breakpoint my matrix value are not {0....0}