Trippy trails mode
If you are craving hallucinogenic simulations, we'll introduce a "trippy trails mode" to our visualizations! The implementation is added to the RenderBox
library itself. If you're using the completed RenderBox
library, then just toggle on the mode in your app. For example, in setup()
of MainActivity
, add the following line of code at the end:
RenderBox.mainCamera.trailsMode = true;
To implement it in your copy of RenderBox
library, open that project (in Android Studio). In the Camera
class (the components/Camera.java
file), add public boolean trailsMode
:
public boolean trailsMode;
Then, in onDrawEye
, instead of erasing the screen for the new frame, we'll draw a full screen quad over the entire frame, with alpha transparency, thus leaving behind a ghostly faded image of the last frame. Every subsequent frame is overdrawn by more semi-transparent black, causing them to fade out over time. Define a color value as follows:
public static float...