public:t-gede-14-1:lab1
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:lab1 [2014/01/11 09:47] – [Lab Project] marino | public:t-gede-14-1:lab1 [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| This first Lab assignment is intended to get the Ogre3D environment started. Getting the development environment set up and configured can be a little tricky for the first time, so this Lab will be solely used to get the "Hello World" of Ogre3D built.\\ | This first Lab assignment is intended to get the Ogre3D environment started. Getting the development environment set up and configured can be a little tricky for the first time, so this Lab will be solely used to get the "Hello World" of Ogre3D built.\\ | ||
| - | There will be a paper hand out in the first lab class that will take you through the basic application step by step. I strongly encourage you to try to understand the steps not just writing it down like a zombie parrot, as the follow up Labs will all be built on top of the base you create in Lab 1. | + | There will be a pdf guide that will take you through the basic application step by step. I strongly encourage you to try to understand the steps not just writing it down like a zombie parrot, as the follow up Labs will all be built on top of the base you create in Lab 1. |
| ===== Discussion ===== | ===== Discussion ===== | ||
| Line 11: | Line 11: | ||
| - Download and install C++ development environment, | - Download and install C++ development environment, | ||
| - | + | - Download and install [[http:// | |
| - | * Download and install [[http:// | + | |
| Line 18: | Line 17: | ||
| - | * Create a system environment variable **OGRE_HOME** that points to Ogre SDK folder. You can then refer to this variable in your project setup as $(OGRE_HOME). This is so that you can easily take your project to a different machine where Ogre might be installed in a different folder. If each machine defines this variable, the project should be able to find the needed includes and libraries (see below). '' | + | |
| + | - **The Ogre run-time libraries (DLLs)** are in folders called bin/debug and bin/release inside the SDK folder. You need to add these two folders to your system path variable so that the system can find them when you launch your application. | ||
| + | - **It is good to organize all your lab source code**, from the very beginning of this class to avoid a complete mess later. VC++ helps you organize the code into **solutions** and **projects**. A solution is really a collection of projects, which is a great way to keep track of labs. Once you launch VC++, create a new project called " | ||
| + | - **Right-click on your project inside VC++ project explorer** and choose '' | ||
| + | - **Change your build output directory: | ||
| + | - **Add additional include libraries: | ||
| + | </ | ||
| + | - **Add connections to additional Ogre and input libraries: | ||
| + | </ | ||
| + | - **Also you will need to add additional Library folders** where the Ogre specific libraries and the required boost libraries are stored: Linker-> | ||
| + | - **If you are using a different version of Visual studio than 2010,** make sure to be using the vc100 toolset < | ||
| + | </ | ||
| + | - Copy **plugins_d.cfg** and **resources_d.cfg** from the SDK bin/debug folder into your own GEDE2013/ | ||
| + | Example: where the Ogre SDK path is " | ||
| + | '' | ||
| + | '' | ||
| + | Make sure to change all references of ../../ to your absalute path.\\ | ||
| + | Notice that Ogre cfg file wants forward slashes!\\ | ||
| + | </ | ||
| + | ===== Lab Project ===== | ||
| + | You should now follow the guide from " | ||
| - | * The Ogre run-time libraries (DLLs) are in folders called bin/ | + | The first 2 labs will be following this guide and getting familiar with the Ogre3D environment. |
| + | <box red 100% | Note:> | ||
| + | After line 2 in section 2 of the Guide, please | ||
| + | <code cpp> | ||
| + | sceneManager-> | ||
| + | </ | ||
| + | </ | ||
| + | Your final results should look something like this: | ||
| + | {{ : | ||
| - | * It is good to organize all your lab source code from the very beginning of this class to avoid a complete mess later. VC++ helps you organize the code into **solutions** and **projects**. A solution is really a collection of projects, which is a great way to keep track of labs. Once you launch VC++, create a new project called " | + | ===== CODE ===== |
| + | <code cpp> | ||
| + | # | ||
| + | |||
| + | int main() | ||
| + | { | ||
| + | | ||
| - | * Right-click on your project inside VC++ project explorer and choose **properties**. Add Ogre folders and files in several locations within the properties: | + | if(!root-> |
| + | return -1; | ||
| + | } | ||
| + | |||
| + | Ogre:: | ||
| - | Configuration Properties->General-> | + | Ogre:: |
| - | Add '' | + | |
| - | '' | + | |
| - | This will help with organizing the builds for each lab project. | + | |
| - | C/C++->General-> | + | Ogre:: |
| - | '' | + | camera-> |
| - | <box red 100% | Note: >If the C/C++ tap is missing. For some reason, with some versions of Visual Studio you will need to have created a cpp file in order to get the C/C++ tap in the configuration properties, so adding a main.cpp file with a basic "hello world" to the project and building it will suffice. | + | camera-> |
| - | </ | + | camera->setNearClipDistance(5); |
| - | Linker->Input-> | + | |
| - | '' | + | |
| - | note: Add this to the end of the current string, do not replace it, and make sure to seperate it with a semicolon. | + | |
| - | Linker->General-> | + | Ogre:: |
| - | '' | + | viewport-> |
| - | Finally if you are using a different version of Visual studio than 2010, make sure to be using the vc100 toolset\\ | + | camera->setAspectRatio(Ogre:: |
| - | Project Configuration->General->Platform Toolset = '' | + | |
| - | * Copy **plugins_d.cfg** and **resources_d.cfg** from the SDK bin/debug folder into your own GEDE2013/ | ||
| - | Example: where the Ogre SDK path is " | ||
| - | '' | ||
| - | '' | ||
| - | <box red 100% | Note >Make sure to change all references of ../../ to your absalute path.\\ | ||
| - | Notice that Ogre cfg file wants forward slashes!\\ | ||
| - | </ | ||
| - | ===== Lab Project ===== | ||
| - | You should now follow the hand out given to you by the instructor. For this Lab we will only do the sections 1 - 3 of the Ogre 3D beginners Guide. The rest will be covered in the next Lab assignment.\\ | ||
| - | After line 2 in section 2 of the Guide, please add these lines to the code. Since the Ogre 1.9 default Scene Manager does not set the ambient light by default, we have to that our selves. | + | // |
| - | <code cpp> | + | |
| - | sceneManager->setAmbientLight(Ogre::ColourValue(0.3f, 0.3f, 0.3f)); | + | Ogre:: |
| - | </ | + | Ogre:: |
| + | cf.load(" | ||
| + | Ogre:: | ||
| + | |||
| + | while(sectionIter.hasMoreElements()) { | ||
| + | sectionName = sectionIter.peekNextKey(); | ||
| + | Ogre:: | ||
| + | Ogre:: | ||
| + | for( i = settings->begin() ; i != settings-> | ||
| + | typeName = i-> | ||
| + | dataName = i-> | ||
| + | Ogre::ResourceGroupManager:: | ||
| + | } | ||
| + | } | ||
| + | Ogre:: | ||
| - | Your final results should look something like this: | + | Ogre::Entity* ent = sceneManager-> |
| - | {{ :public:t-gede-14-1: | + | sceneManager-> |
| + | sceneManager-> | ||
| + | root-> | ||
| + | |||
| + | return 0; | ||
| + | } | ||
| + | </ | ||
| ===== When You Are Finished ===== | ===== When You Are Finished ===== | ||
| Upload your **commented source files** into Lab1 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 Lab1 in MySchool (zip them up if more than one). The lab projects will not be graded, but their completion counts towards your participation grade. | ||
| + | |||
| + | And check out the next [[public: | ||
/var/www/cadia.ru.is/wiki/data/attic/public/t-gede-14-1/lab1.1389433655.txt.gz · Last modified: 2024/04/29 13:32 (external edit)