Frage

don't ask me why, but I need to draw a 3d figure using MFC I created classes of matrix and vectors. I am calculating ViewMatrix(inverse camera matrix) and Projection Matrix.

Every vertex I multiply by world view and projection matrix. I divide this vector by W and I get x,y coords of the viewport. I also extract a quintillion from a WorldViewMatrix and multiply it by normal vector to get a normal of this polygon.

I want to calculate the color of each point of triangle but I don't know how to do it. I can create triangles from projected coords and for calculating the light for each point get their position by multiplying by the inverse matrix of the projections. But it is too slow.

I would like to know how it is realised on real GPUs. They have vertex and points and others shaders. I want to do something like this.

War es hilfreich?

Lösung

I think you will need to use OpenGL or DirectX inside your MFC application. I already did an integration with OpenGL ... 10 years ago ... I don't remember how I made it.

If it is ever possible with the Native Win32 GDI and GDI+ technologies, it will be very limited in 3d capabilities.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top