hi there,
first of all, this is really cool stuff! respect to Zaknafein, truly suitable to show what tv can do! i'd like to convert this demo to c++ but have some troubles with overloaded operators:
(all snippets are part of the 'updateWater' function from the file 'Water.cs')
QUESTION 1
variable types (in c++):
cTV_3DMATRIX reflView = gTVCam->GetRotationMatrix();
cTV_3DMATRIX* m_reflectMat;
the c# source says:
reflView *= m_reflectMat;
does the following line do the same?
gTVMathLib->TVMatrixMultiply(&reflView, &reflView, m_reflectMat);
(i tried to multiply two non-pointer cTV_3DMATRIX variables but the overloaded * operator does not work)
QUESTION 2
c# source:
TV_4DVECTOR clipPlane = new TV_4DVECTOR();
...
TV_4DVECTOR q;
...
TV_4DVECTOR scaledPlaneVector = clipPlane * (1.0f / (clipPlane * q));
my c++ converting attempt due to the lack of overloaded operators (or due to my lack of knowledge how to use these..):
cTV_4DVECTOR clipPlane;
cTV_4DVECTOR q;
cTV_4DVECTOR scaledPlaneVector;
q.x = sign(clipPlane.x) / culledProj.m11;
q.y = sign(clipPlane.y) / culledProj.m22;
q.z = 1.0f;
q.w = (1.0f - culledProj.m33) / culledProj.m43;
scaledPlaneVector.x = clipPlane.x * (1.0f / (clipPlane.x * q.x));
scaledPlaneVector.y = clipPlane.y * (1.0f / (clipPlane.y * q.y));
scaledPlaneVector.z = clipPlane.z * (1.0f / (clipPlane.z * q.z));
scaledPlaneVector.w = clipPlane.w * (1.0f / (clipPlane.w * q.w));
does this c++ code do the same as the c# source? or is the * operator an alias for cross or dot product?
thanks in advance for shedding any light on this
cheers
j