Transparency

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:

Figure 5.19. The sphere on the far left has an EntityAlpha of 1, the one in the middle has a value of 0.5, and the one on the right has a value of 0.2.


sphere = CreateSphere()
EntityAlpha sphere, 0.5

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.112.187