|
CaptureDepth | |
CaptureDepth ZdepthValue | |
Parameters: ZdepthValue = The Z depth to use for the following captured graphic commands |
|
Returns: NONE | |
CaptureDepth sets the Z depth that any following captured graphics commands will be stored at when captured to the scene buffer. The captured item will be rendered based upon it's depth within the list captured items. Items with a higher depth value are depth before those with lower values. FACTS: * CaptureDepth values must be positive (0 and higher) Mini Tutorial: This example first creates a camera in part 1. Then in the second part it redirects all graphics output to PB's scene buffer. Using the CaptureDepth to control the order of the drawn items
If you test this example, you should notice something interesting occurring. While it simply draws two overlapping Blue & RED circles through a camera. If you look carefully, You'll may have noticed that even while the code renders the BLUE circle first, then the RED circle. The RED circle is actually drawn behind the BLUE circle. This occurs because prior to rendering each circle to the scene buffer, the code sets the Capturing Z depth of the following items we about to draw with the CaptureDepth command. If you look closely, the Blue circle is being captured at a depth of 1, while the Red circle is being capture a depth of 20. So what the camera does, is first order the items in the scene buffer from highest Z depth to lowest, then renders them in this order (highest to lowest). So items with a higher z depth, will be drawn behind items with a lower Z depth, regardless of what order we capture these drawing requests to the scene buffer in. |
Related Info: | CameraBasics | CaptureToScene | CaptureVis | ClsScene | DrawGFXImmediate | GetCaptureDepth : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |