문제

I have a 3D array representing a 3D object (x,y,z). The values stored in the array are RGB colors. Is it possible to generate an image of the object from any given point of view?

도움이 되었습니까?

해결책

That is certainly possible. The keywords here are transformation and projection, basically you define a point for every (3D) Pixel inside your array. Then you multiply all the points with a bunch of matrices and get a 2-dimensional result.

Here is an article about how OpenGL does it's transformations: http://www.songho.ca/opengl/gl_projectionmatrix.html

You could mimic the whole pipeline in C++ to produce a bitmap on your CPU or use OpenGL directly which would be a thousand times faster. When using OpenGL you could also view your model in realtime from all sides, but that would essentially be a full 3D-Application.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top