MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
quarc_visualization_material_properties_demoQUARC Visualization Material Properties
This is an example of different material options. You if you run the demo model, you should see four spheres as shown below.
The background color and ambient light has been set to black to emphasize the various lighting effects. The first sphere on the left uses just diffuse lighting (the basic color property). The shading is only dependent on the location of the light source.
The second sphere has specular lighting set to white with a shininess of 0.05. The third sphere also has specular lighting, but with a shininess value of 0.99. Note that specular lighting is very dependent on the geometry resolution. It may have little or no effect on a low resolution mesh. Specular lighting is dependent on both the location of the light source and your viewing location relative to the surface normal and light source location.
The fourth and final mesh no longer has specular lighting, but instead has its emissivity set to 1. This means that all vertices are fully lit which can be useful particularly for user-interface elements where you want textures to be illuminated regardless of the lights in the scene. Emissivity only affects the actor it is applied to and will not cast light on surrounding objects. For a value between 0 and 1, emissivity can be thought of as an ambient light setting on a per actor basis.
Demonstration
To start the model, click the Ctrl+T while the diagram is the active window. Using the A, S, D, and W keys on your keyboard, you can move around the scene. Click-drag your mouse on the visualization window to rotate your view.
button on the toolbar, select from the menu of the diagram, or pressIf you would like to run the model in external mode, then select
from the menu of the diagram, or select from the simulation mode combo box on the toolbar.Then select Ctrl+B while the diagram is the active window. A great deal of output will appear in the Diagnostic Viewer about the progress of the build. If you cannot see the Diagnostic Viewer, you can open it by selecting from the menu of the diagram, or clicking on the View Diagnostics hyperlink at the bottom of the diagram. If you have MATLAB R2013b or earlier then the output will appear in the MATLAB Command Window.
from the menu of the diagram, or pressWhen the build is complete, click on the
button or select from the menu of the diagram to connect to the model.Finally, start the model by clicking on the
button or selecting from the menu of the diagram. The item of the menu may also be used to both connect and start the model in one operation.Click on the
button or select from the menu of the diagram to stop the model. The item of the menu may also be used.Running the example on a different target
To run the example on a different target, refer to the instructions on the Running QUARC Examples on Remote Targets page.
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.