After a bit more work the first part of the algorithm is on screen. The volume is rendered to a temporary image buffer, where every voxel maps to a single pixel. This buffer is currently just copied to the screen, eventually this step will include the warping part of the algorithm.
----------------------
Without any major problems the shear is now implemented. I also put lighting back in, so the shear can be seen much more easily.
The lit skull, looking directly along the X axis so there is no shear.
Rotated to the left and right, the shear can be seen working.
This is my maths scribblings for calculating how big the shear should be. The result was that the distance of the shear (r) is
width * (depth / sin(angle)) / (width / cos(angle))
Width and depth here are terms for figuring out the calculation here. In the actual code they could be the width/depth/height of the volume, depending which axis is being looked down and which shear is being calculated (horizontal or vertical in screen-space).
The next step is to implement the warp to display the volume properly, and also to correctly handle viewing the volume down both the positive and negative X axis. Then the Y and Z axes need to be implemented, which once X is done should be simple.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment