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
Merged

Conversation

bohdankornienko
Copy link
Contributor

Here is the second tutorial in the Basic Tutorial series.


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

@paroj paroj Sep 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a list instead of manual line-breaks here

//! [spotlightposrot]

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bohdankornienko
Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling: deprecated

![](bt2_ninja3.jpg)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@paroj paroj merged commit 1e37a74 into OGRECave:master Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants