public:t-gede-14-1:lab7
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:t-gede-14-1:lab7 [2014/03/03 17:57] – [Bonus] marino | public:t-gede-14-1:lab7 [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | + | ||
| - | This lab is based on a variety of sources, including the [[http:// | + | |
| + | This lab is based on a variety of sources, including the [[http:// | ||
| + | |||
| ===== Discussion ===== | ===== Discussion ===== | ||
| - | Discussion thread for this lab is here: [[http://ruclasses.proboards.com/index.cgi?action=display& | + | Discussion thread for this lab is here: [[https://piazza.com/class/ |
| ===== Goal ====== | ===== Goal ====== | ||
| Line 22: | Line 22: | ||
| Follow these steps to complete the lab project: | Follow these steps to complete the lab project: | ||
| - | - **Create a New Project** Create a new empty project called "Lab6" in the same way you have created new projects for other lab projects. Create the Lab6Main.cpp file that contains a minimal Ogre application that displays at least one ground plane and an Ogre model. You can use your own application, | + | - **Create a New Project** Create a new empty project called "Lab7" in the same way you have created new projects for other lab projects. You can use your own application, |
| - | #include " | + | |
| - | + | ||
| - | class MyApplication | + | |
| - | private: | + | |
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | Ogre::Camera* _camera; | + | |
| - | + | ||
| - | public: | + | |
| - | + | ||
| - | MyApplication() { | + | |
| - | _sceneManager = NULL; | + | |
| - | _root = NULL; | + | |
| - | _ogre = NULL; | + | |
| - | _ground = NULL; | + | |
| - | } | + | |
| - | + | ||
| - | ~MyApplication() { | + | |
| - | delete _root; | + | |
| - | } | + | |
| - | + | ||
| - | void loadResources() { | + | |
| - | Ogre:: | + | |
| - | cf.load(" | + | |
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | while(sectionIter.hasMoreElements()) { | + | |
| - | sectionName=sectionIter.peekNextKey(); | + | |
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | for(i=settings-> | + | |
| - | typeName=i-> | + | |
| - | dataName=i-> | + | |
| - | Ogre:: | + | |
| - | } | + | |
| - | } | + | |
| - | Ogre:: | + | |
| - | } | + | |
| - | + | ||
| - | void createScene() { | + | |
| - | _ogre =_sceneManager-> | + | |
| - | _sceneManager-> | + | |
| - | + | ||
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | Ogre:: | + | |
| - | _sceneManager-> | + | |
| - | + | ||
| - | // HERE YOU SET THE MATERIALS FOR EACH OBJECT | + | |
| - | // e.g. _ogre-> | + | |
| - | // e.g. _ground-> | + | |
| - | + | ||
| - | Ogre:: | + | |
| - | light-> | + | |
| - | light-> | + | |
| - | } | + | |
| - | + | ||
| - | int startup() { | + | |
| - | _root=new Ogre:: | + | |
| - | if(!_root-> | + | |
| - | return -1; | + | |
| - | } | + | |
| - | + | ||
| - | Ogre:: | + | |
| - | _sceneManager=_root-> | + | |
| - | + | ||
| - | _camera=_sceneManager-> | + | |
| - | _camera-> | + | |
| - | _camera-> | + | |
| - | _camera-> | + | |
| - | + | ||
| - | Ogre:: | + | |
| - | viewport-> | + | |
| - | _camera-> | + | |
| - | + | ||
| - | loadResources(); | + | |
| - | createScene(); | + | |
| - | + | ||
| - | _root-> | + | |
| - | return 0; | + | |
| - | + | ||
| - | } | + | |
| - | }; | + | |
| - | + | ||
| - | + | ||
| - | int main(void) { | + | |
| - | MyApplication app; | + | |
| - | app.startup(); | + | |
| - | return 0; | + | |
| - | } | + | |
| - | </ | + | |
| - **Fixed Diffuse Color Fragment Shader** The first shader program we create is a fragment shader that simply returns a fixed color for each fragment that gets processed. In Ogre you can write shader programs in any of the major high-level shading languages, but we will be using **Cg**. Create a new shader program file called '' | - **Fixed Diffuse Color Fragment Shader** The first shader program we create is a fragment shader that simply returns a fixed color for each fragment that gets processed. In Ogre you can write shader programs in any of the major high-level shading languages, but we will be using **Cg**. Create a new shader program file called '' | ||
| float4 main_orange_fp(in float3 TexelPos : TEXCOORD0) : COLOR { | float4 main_orange_fp(in float3 TexelPos : TEXCOORD0) : COLOR { | ||
| Line 561: | Line 468: | ||
| ===== When You Are Finished ===== | ===== When You Are Finished ===== | ||
| - | Upload your **commented source files** into Lab6 in MySchool (zip them up if more than one). The lab projects will not be graded, but their completion counts towards your participation grade. | + | Upload your **commented source files** into Lab7 in MySchool |
/var/www/cadia.ru.is/wiki/data/attic/public/t-gede-14-1/lab7.1393869427.txt.gz · Last modified: 2024/04/29 13:32 (external edit)