I would like to know the vector is deal with row vector or column vector in SDK?(You know it is very import to calculate vector with matrix).
It seems the matrix is prepared for row vector since I read the following from “PVRTVector.h”:
== BEGIN ==
@Returns a PVRTMat4 corresponding to the requested translation
@Description Calculates a 4x4 matrix corresponding to a transformation
of tx, ty and tz distance in each axis.
static PVRTMat4 Translation(const VERTTYPE tx, const VERTTYPE ty, const VERTTYPE tz)
== END ==
So the translation matrix will be:
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
tx ty tz 1.0
However another function I read from same file:
== BEGIN ==
@Input rhs a PVRTMat4
@Returns result of multiplication
@Description matrix multiplication operator PVRTVec4 and PVRTMat4
PVRTVec4 PVRTVec4::operator(const PVRTMat4& rhs) const
out.x = VERTTYPEMUL(x,rhs.f)+VERTTYPEMUL(y,rhs.f)+VERTTYPEMUL(z,rhs.f)+VERTTYPEMUL(w,rhs.f);
out.y = VERTTYPEMUL(x,rhs.f)+VERTTYPEMUL(y,rhs.f)+VERTTYPEMUL(z,rhs.f)+VERTTYPEMUL(w,rhs.f);
out.z = VERTTYPEMUL(x,rhs.f)+VERTTYPEMUL(y,rhs.f)+VERTTYPEMUL(z,rhs.f)+VERTTYPEMUL(w,rhs.f);
out.w = VERTTYPEMUL(x,rhs.f)+VERTTYPEMUL(y,rhs.f)+VERTTYPEMUL(z,rhs.f)+VERTTYPEMUL(w,rhs.f);
== END ==
Thus it seems vector is deal with column when PVRTVec4 * PVRTMat4.
E.g. there is PVRTVec4 V(A, B, C, 1.0) and the above translation matrix M,
so V * M =
A1.0 + B0.0 + C0.0 + 1.00.0,
A0.0 + B1.0 + C0.0 + 1.00.0,
A0.0 + B0.0 + C0.0 + 1.00.0,
Atx + Bty + Ctz + 1.0*1.0
Observably they are contradictory and I always got wrong resultOuch.
Please confirm that or correct me if I’m wrong.
Hi, I had a brief look at this and it does seem like there may be a problem. I’ve filed this as an issue in our system (BRN35318) for further investigation - you can look for this number in our release notes for a fix if there is no further post here.
Thanks for your reply, I’ve modified the source on my side to get correct result. Could I access your bug trace system as customer to know more details?
We don’t normally allow access to our bug tracking outside the company. If you are a customer of ours then you may have access to more details through the IPGear system.
May I ask, which function did you change in your own code?
sorry for so late reply.