Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogre/Samples/EnvMapping/include/EnvMapping.h @ 28

Last change on this file since 28 was 5, checked in by anonymous, 17 years ago

=hoffentlich gehts jetzt

File size: 1.6 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 Torus Knot Software Ltd
8Also see acknowledgements in Readme.html
9
10You may use this sample code for anything you like, it is not covered by the
11LGPL like the rest of the engine.
12-----------------------------------------------------------------------------
13*/
14
15/**
16    \file
17        EnvMapping.cpp
18    \brief
19        Specialisation of OGRE's framework application to show the
20        environment mapping feature.
21*/
22
23#include "ExampleApplication.h"
24
25class EnvMapApplication : public ExampleApplication
26{
27public:
28    EnvMapApplication() {}
29
30protected:
31
32    // Just override the mandatory create scene method
33    void createScene(void)
34    {
35        // Set ambient light
36        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
37
38        // Create a point light
39        Light* l = mSceneMgr->createLight("MainLight");
40        // Accept default settings: point light, white diffuse, just set position
41        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
42        //  other objects, but I don't
43        l->setPosition(20,80,50);
44
45
46        Entity *ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
47
48
49        // Set material loaded from Example.material
50        ent->setMaterialName("Examples/EnvMappedRustySteel");
51
52        // Add entity to the root scene node
53        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
54
55
56       
57
58    }
59
60};
Note: See TracBrowser for help on using the repository browser.