A box revolving in some axis.. software rendered using scanline technique. The box rotates realtime with very good fps. The result of the scanline is saved in a software buffer. Then the image from the buffer which is in RAM is drawn to the frame buffer (color buffer) using glDrawPixel(...) in 2D orthographic mode.
//rotate the boxPressing the s or the p key will save the current frame as tga file.
box->RHAnimate(3.8);
//clear the software buffer..
BUFFER->ClearColorBuffer(0, 0, 255);
//do the scanline conversion..
scanline->ScanObject(box);
//draw to frame buffer...
glRasterPos2f(-1, -1);
glDrawPixels(600, 600, GL_RGB, GL_UNSIGNED_BYTE, BUFFER->GetColorBuffer());
- p - from the software buffer.
- s - from the opengl frame buffer
Still need to fix one more thing before procedding further..
In the picture there are two lines visible. This lines ofcourse should not be there.... and is occuring due to loss of information when a floating point is converted to inetger value.
0 Comments:
Post a Comment
<< Home