If you’re a fan of the television series Star Trek (and if you’re reading this book, you probably are), you’re probably familiar with the term “cloaking.” When a Klingon ship wanted to make itself invisible, it would cloak itself so that it couldn’t be detected. We can “cloak” objects that we have created in Blitz3D by using the Alpha command. The Alpha command allows you to set a level of transparency for an object. Typically, you would set a number for the Alpha between 0 and 1. For example, if you entered an Alpha level of 0.5, the object would be 50% see-through. If you entered a value of 0, the object would be invisible, and if you entered a value of 1, the object would be seen in its entirety. Figure 5.19 shows an example of different alpha values applied to a sphere. Here is the code for creating a cube and then making it 50% transparent:
sphere = CreateSphere() EntityAlpha sphere, 0.5
3.145.112.187