3D Raycasting Engine in LabVIEW

When I worked at VI Engineering, I learned how to use a graphical programming language called LabVIEW. All CoOp students do some kind of project to really get into the different details of LabVIEW. My 3D raycasting engine was one of the these I worked on as side projects and a learning experience.

On the left, you will see a final screen capture of the engine in action. This includes the following features:

-Specular Reflection

-Skysphere

-Transparency

-Edge Shading

-3D Movement With Block Collision and Gravity(Not shown)

-Block Placement and Removal(Minecraft Clone)

The textures are simple in this picture. However, I did implement the ability to load and map textures to each block type.

Here you can see 4 different stages of my work.

    1. One of the earliest stages of my work. Using rays that check intersections at set increments using a variable.

    2. I added block shading by taking the coordinates within the intersected block, and calculating the distance from its center, then using that distance to modify the color sent back to the image.

  1. I created a basic algorithm to create 3 arrays, one for each type of intersection, x plane, y plane, z plane. This allowed me to finally see properly shaped cubes, as I was intersecting on surfaces instead of inside them.

    1. I recreated my algorithm for detecting block faces. This almost doubled the frame rate of the engine under normal scenarios.

    1. This is a simple diagram that I created to help display what my code was doing. How it was detecting face intersection, with faces in a darker blue, and the detected cubes in a sky blue.

    1. On the left side of this image, you can see the old algorithm, with each set of intersections, x plane, y plane, and z plane, indicated by 3 different colors.

    2. On the right side, you can see the new algorithm, propagating the ray by the calculated distance to the next face, increasing its color value the more calculations it had to do before stopping. This acted to stop calculations when a block was seen, increasing performance, and making into a raycasting engine.

    1. I added secular reflection and partial transparency. By simply generating two rays when my ray intersected a certain type of materiel, I could then assign weights to each ray for how transparent or reflective the material was. Below is a simple diagram displaying transparency and reflection working.

    1. I also added sky spheres, which was very simple to do, just by converting the vectors I had already created for look direction, taking their components, and grabbing a pixel value from file. There were lots of available sky spheres that supported my method found here.

    2. Here is another later image with no color. In a simple voxel model editor proof of concept. I also created a method to draw edges.