Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Tutorial 2 - Porting from wiki #523

Merged
merged 4 commits into from Sep 27, 2017

Conversation

Projects
None yet
2 participants
@bohdankornienko
Copy link
Contributor

commented Sep 15, 2017

Here is the second tutorial in the Basic Tutorial series.


//! [spotlightposrot]
spotLight->setDirection(-1, -1, 0);
spotLight->setPosition(Ogre::Vector3(200, 200, 0));

This comment has been minimized.

Copy link
@paroj

paroj Sep 16, 2017

Member

Node-less positioning of light nodes is deprecated. Please change to node base positioning.

@subpage basictutorial1
If you need help with the set up, then read @ref setup.

@subpage basictutorial1 <br/>

This comment has been minimized.

Copy link
@paroj

paroj Sep 18, 2017

Member

use a list instead of manual line-breaks here

//! [spotlightposrot]

//! [spotlightrange]
spotLight->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(50));

This comment has been minimized.

Copy link
@paroj

paroj Sep 18, 2017

Member

you can just do ˋusing namespace Ogre;ˋ somewhere instead of using the Ogre:: prefix everywhere to keep things more readable.

@bohdankornienko bohdankornienko force-pushed the bohdankornienko:docs branch from 7604eba to 2f5c200 Sep 22, 2017

@bohdankornienko

This comment has been minimized.

Copy link
Contributor Author

commented Sep 22, 2017

Sorry for delay. Has to reread tutorial and fix some code with last updates.


# The Ogre Camera Class {#bt2TheOgreCameraClass}
A Camera is the object we use to view our scene. A Ogre::Camera is a special object that works similar to a Ogre::SceneNode. It has methods like setPosition and yaw. You can also attach it to a SceneNode. For instance, you might want to temporarily attach your Camera to a SceneNode that follows a path through the sky to create an aerial cutscene. Just like a SceneNode the Camera's position will be relative to its parent SceneNode. The Camera is not a SceneNode (it actually inherits from the Frustum class), but for movement and rotation, you can treat it like a SceneNode.
@note Starting from version 1.10 functionality related to rotate and translate camera are depricated. You should attach camera to Ogre::SceneNode and do all transofrmation with this node.

This comment has been minimized.

Copy link
@paroj

paroj Sep 26, 2017

Member

spelling: deprecated


@snippet Samples/Tutorials/BasicTutorial2.cpp spotlightposrot

@note You must be wondering why we call setDirection for light source and then call the same method for related SceneNode. As long as setDirection is depricated for Light it has to be attached to SceneNode. Since SceneNode default rotation is NEGATIVE\_UNIT\_Z we need to set same value for Light. Direction for light by default is not NEGATIVE\_UNIT\_Z but in the future releases it will be replaced with this value. So this extra call of setDirection for Light could be deleted in future. In other words we need this extra move for future compatibilty.

This comment has been minimized.

Copy link
@paroj

paroj Sep 26, 2017

Member

spelling: deprecated

![](bt2_ninja3.jpg)

# Shadow Types {#ShadowTypes}
Ogre currently supports three types of Shadows:

This comment has been minimized.

Copy link
@paroj

paroj Sep 26, 2017

Member

actually it is six. probably it is better to just reference the enum here: https://ogrecave.github.io/ogre/api/1.10/group___general.html#ga79dcd426d291c31072c1ad6f183715d6

@@ -14,9 +14,14 @@ file(COPY ${OGRE_CONFIG_DIR}/plugins.cfg ${OGRE_CONFIG_DIR}/resources.cfg
DESTINATION ${CMAKE_BINARY_DIR})
## [discover_ogre]

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")

This comment has been minimized.

Copy link
@paroj

paroj Sep 26, 2017

Member

were you trying to get that deprecation waring? this does not seem to be needed.

This comment has been minimized.

Copy link
@bohdankornienko

bohdankornienko Sep 27, 2017

Author Contributor

In all code I am porting from tutorials. Just for you not to correct me all the time.

This comment has been minimized.

Copy link
@paroj

paroj Sep 27, 2017

Member

you should rather set this in cmake-gui instead of hardcoding it here

@paroj

paroj approved these changes Sep 27, 2017

@paroj paroj merged commit 1e37a74 into OGRECave:master Sep 27, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@bohdankornienko bohdankornienko deleted the bohdankornienko:docs branch Sep 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.