User Tools

Site Tools


public:t-vien-10-3:lab_6_materials

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:t-vien-10-3:lab_6_materials [2010/10/21 16:14]
angelo
public:t-vien-10-3:lab_6_materials [2010/10/21 16:15] (current)
angelo
Line 65: Line 65:
             rolloverSound = <your sound here>,             rolloverSound = <your sound here>,
             clickSound = <your sound here>,              clickSound = <your sound here>, 
-            parent=<parent node here>)</code> You can use the sounds from this week's gui demo or simply not specify new sounds to use the default Panda3D sounds.  The function that the button calls, should be a function that toggles the HUD panel between fully visible and mostly hidden.  There's already a **toggleHUD** method stub you could use.  Remember that you have to set the button position in the **redraw** method.  A good position of the button is **(0.18,0,0.32)** if you are using the panel as parent or **(-base.getAspectRatio()+0.535,0,-0.26)** if you are using render2d as parent.  +            parent=<parent node here>)</code> You can use the sounds from this week's gui demo or simply not specify new sounds to use the default Panda3D sounds.  The function that the button calls, should be a function that toggles the HUD panel between fully visible and mostly hidden.  There's already a **toggleHUD** method stub you could use.  Remember that you have to set the button position in the **redraw** method.  A good position of the button is **(0.18,0,0.32)** if you are using the panel as parent or **(-base.getAspectRatio()+0.535,0,-0.26)** if you are using aspect2d as parent.  
     - Set up a couple of intervals that will slide the panel in and out of view.  You can make it slide down until all you can see is the button.  Fill in the **toggleHUD** method to start the correct interval when the button is pressed.       - Set up a couple of intervals that will slide the panel in and out of view.  You can make it slide down until all you can see is the button.  Fill in the **toggleHUD** method to start the correct interval when the button is pressed.  
   - **Adding an Overhead Map:**\\ The following code is an **OverheadMap** object that can be attached to a scene graph.  Add this object to your panel and have it show you where your avatar is located any given moment.  It is good for you to know that the world dimensions in the x-y plane are approximately **(-128,-68,48,48)**.  You will need to scale and reposition your map until it fits the panel depression.  Also, to enable transparency on the 2D scene graph, you'll need to call **setTransparency** again because it is a separate scene graph from **render**.  Make sure this is all working fine.<code python>   - **Adding an Overhead Map:**\\ The following code is an **OverheadMap** object that can be attached to a scene graph.  Add this object to your panel and have it show you where your avatar is located any given moment.  It is good for you to know that the world dimensions in the x-y plane are approximately **(-128,-68,48,48)**.  You will need to scale and reposition your map until it fits the panel depression.  Also, to enable transparency on the 2D scene graph, you'll need to call **setTransparency** again because it is a separate scene graph from **render**.  Make sure this is all working fine.<code python>
/var/www/ailab/WWW/wiki/data/pages/public/t-vien-10-3/lab_6_materials.txt ยท Last modified: 2010/10/21 16:15 by angelo