Table of Contents > QUARC > User's Guide > Creating User Interfaces > Creating Visualizations > Creating Your Own Content
Creating Sky Boxes
A skybox is a visual trick to create a more realistic environment by providing a background that is infinitely far away. By mapping the appropriate texture on the inside of the box it can appear seamless. For the most basic of skyboxes, the skybox is just that -- a box. The main difference is that the faces are pointed inwards instead of outwards as it is intended that the camera will sit in the middle of the box, and the box has no normals so it is always fully lit.
A skybox mesh is included in the
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
dos(sprintf('explorer.exe "%s" &', fullfile(qc_root, 'resources', 'meshes', 'environment', 'sky')));MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
dos(sprintf('explorer.exe "%s" &', fullfile(qc_root, 'resources', 'images', 'environment', 'sky')));If you are interested in creating your own skyboxes, then all you need to do is create an environment to replace the texture on the skybox. You can use a tool such as Daz3D Studio (https://www.daz3d.com/daz_studio). Blender and 3ds Max are also capable of producing the requisite views, but an environmental generation package such as Daz3D Studio has a number of nice tools for procedurally creating skies, clouds, and various vistas.
If you are using Bryce 5.5 to create your skybox, there is a known bug in the software in that the actual view angle is less than the assigned value. You need to set the view angle to 112.5 degrees to get the desired 90 degree view angle. |
After creating your six views, they must be stitched together into a single bitmap. To aid you with this, you can make a copy of the skybox_template.png file and paste your skybox sections over top in a suitable paint program. Make note of the colored numbers on the template file to ensure that you align the correct edges on the top and bottom surfaces. Note that if you create square views (512x512 for example) you may find it easier to assemble them in the same order as the template (resulting in 512x3078) and then stretch the combined bitmap to the requisite power of two dimensions (512x4096 for example).
One of the difficulties in creating skyboxes is to create the seamless edges. It is much easier if there is not a lot of detail that coincides with the seams. It may even be necessary to modify the texture coordinates of the skybox to tune it for your particular bitmap. For this reason, sometimes domes are used instead because the dome can be made in a single continuous mesh, however, then the creation of the texture map becomes more difficult as you then need an image that amounts to an view from a fish-eye lens that can see from horizon to horizon. Sky domes tend to more easily facilitate animated environmental effects such as moving clouds though.
Alternatively, if the camera is controlled from the model and it will not be looking up or down, you can put the camera at the center of a cylinder and use a basic panoramic map. In this case the texture is very easy to create and you only have one seam to contend with, but it only affords a limited amount of vertical camera motion before the illusion is lost. If the camera isn't moving at all (or very limited), then you can even just map a static scene onto a plane and place it in the distance.
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.