Thanks for your reply. I am able to replicate the result you posted, and now want to draw onto the actual face of the cube (I'm modifying the View3D sample). Here's what I have:
EVERTEX3D v[NumVertices];
POINT p[NumVertices];
display->Perspective3D(display->GetWidth(), display->GetHeight());
for(int i = 0; i < NumVertices; i++)
{
cube.GetVertex(i,&v[i]);
display->CalculatePerspective(&v[i].position,&p[i]);
}
// lower-left of front-triangle is 0, 2, 1
display->buffer.TexturePoly(p[0].x, p[0].y, // x1, y1
0, h, // u1, v1
p[2].x, p[2].y, // x2, y2,
0, 0, // u2, v2
p[1].x, p[1].y, // x3, y3
w, h, // u3, v3
&background);
// upper-right of front-triangle is 1, 2, 3
display->buffer.TexturePoly(p[1].x, p[1].y, // x1, y1
w, h, // u1, v1
p[2].x, p[2].y, // x2, y2,
0, 0, // u2, v2
p[3].x, p[3].y, // x3, y3
w, 0, // u3, v3
&background);
The problem is that the CalculatePerspective returns points with values such as (-4,4) for one of the points of the cube, rather than something meaningful like the lower left corener of the actual 320x240 display.
Furthermore, the cube's vertex position is the *original* position, not the rotated one. (I already called cube.rotate per the View3D sample).
Aren't there examples/samples that demonstrate more of the 3D stuff?
Thanks,
Brian