fixed view matrix; im2d UV

This commit is contained in:
aap
2018-06-14 23:17:55 +02:00
parent 5cdc0499c5
commit e6d01b1159
7 changed files with 62 additions and 28 deletions

View File

@@ -207,6 +207,12 @@ cameraSync(ObjectWithFrame *obj)
Camera *cam = (Camera*)obj;
Matrix inv, proj;
Matrix::invertOrthonormal(&inv, cam->getFrame()->getLTM());
inv.right.x = -inv.right.x;
inv.up.x = -inv.up.x;
inv.at.x = -inv.at.x;
inv.pos.x = -inv.pos.x;
float32 xscl = 1.0f/(2.0f*cam->viewWindow.x);
float32 yscl = 1.0f/(2.0f*cam->viewWindow.y);

View File

@@ -51,8 +51,8 @@ struct Im2DVertex
void setCameraZ(float32 z) { }
void setRecipCameraZ(float32 recipz) { this->w = recipz; }
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) { this->color = D3DCOLOR_ARGB(a, r, g, b); }
void setU(float32 u) { this->u = u; }
void setV(float32 v) { this->v = v; }
void setU(float32 u, float recipZ) { this->u = u; }
void setV(float32 v, float recipZ) { this->v = v; }
};
void setD3dMaterial(D3DMATERIAL9 *mat9);

View File

@@ -114,8 +114,8 @@ struct Im2DVertex
void setRecipCameraZ(float32 recipz) { }
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) {
this->r = r; this->g = g; this->b = b; this->a = a; }
void setU(float32 u) { this->u = u; }
void setV(float32 v) { this->v = v; }
void setU(float32 u, float recipz) { this->u = u; }
void setV(float32 v, float recipz) { this->v = v; }
};
void setAttribPointers(AttribDesc *attribDescs, int32 numAttribs);