public:t-vien-07-1:lab_2_materials
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:t-vien-07-1:lab_2_materials [2007/01/19 02:13] – hannes | public:t-vien-07-1:lab_2_materials [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| * Make sure you can run the Panda 3D sample programs on your machine | * Make sure you can run the Panda 3D sample programs on your machine | ||
| + | |||
| + | ===== Useful Links ===== | ||
| + | |||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| ===== In-Class Excercises ===== | ===== In-Class Excercises ===== | ||
| + | |||
| ==== Before You Start ==== | ==== Before You Start ==== | ||
| - | * Download and unzip the Lab 2 Asset File into your working directory | + | * Download and unzip the [[http:// |
| Line 24: | Line 36: | ||
| - | ==== Making a Lighted | + | |
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==== Making a Virtual | ||
| + | |||
| + | {{public: | ||
| - Create a program called myscene.py that moves the camera to the location (-0.5, -3.5, 0.5), changes its heading by -45 degrees and then loads the model " | - Create a program called myscene.py that moves the camera to the location (-0.5, -3.5, 0.5), changes its heading by -45 degrees and then loads the model " | ||
| Line 77: | Line 99: | ||
| if self.keystate[' | if self.keystate[' | ||
| base.camera.setPos(camera, | base.camera.setPos(camera, | ||
| + | self.lasttime = task.time | ||
| return task.cont | return task.cont | ||
| </ | </ | ||
| Line 131: | Line 154: | ||
| def create_lights(self): | def create_lights(self): | ||
| """ | """ | ||
| + | </ | ||
| + | # USEFUL ASSETS: | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| </ | </ | ||
| - | {{public: | + | - Modify the **create_wall** method to pick a random texture for each panel for a greater variety (use the assets below) and finally pass in data into the Room's constructor for building a room with the following shape: \\ {{public: |
| + | # USEFUL ASSETS: | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | </ | ||
| + | - Fill in the code for the **create_lights** method. | ||
| + | # HINT - Creating lights | ||
| + | # Set up the global lighting for general illumination | ||
| + | ambient_source = AmbientLight(' | ||
| + | ambient_source.setColor(Vec4(1, | ||
| + | ambient = root.attachNewNode(ambient_source.upcastToPandaNode()) | ||
| + | root.setLight(ambient) | ||
| + | # Set up a spotlight for localized illumination | ||
| + | lens = PerspectiveLens() | ||
| + | lens.setNearFar(0.1, | ||
| + | spot_source = Spotlight(' | ||
| + | spot_source.setColor(Vec4(1, | ||
| + | spot_source.setAttenuation(Vec3(0, | ||
| + | ## spot_source.showFrustum() # Uncomment for great debug information | ||
| + | spot_source.setLens(lens) | ||
| + | spot = root.attachNewNode(spot_source.upcastToLensNode()) | ||
| + | spot.setPos(Vec3(1, | ||
| + | spot.setHpr(0, | ||
| + | root.setLight(spot) | ||
| + | </ | ||
| + | - Modify the spotlight creation in the **create_lights** methods so that it creats a spotlight for each of the ceiling panels that have light fixtures in them. | ||
/var/www/cadia.ru.is/wiki/data/attic/public/t-vien-07-1/lab_2_materials.1169172835.txt.gz · Last modified: 2024/04/29 13:33 (external edit)