Can we improve the wiki tutorials?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Ghelgason
Gnoblar
Posts: 6
Joined: Fri Jul 11, 2014 10:10 pm

Can we improve the wiki tutorials?

Post by Ghelgason »

It can be frustrating to install something when the installation guide is not accurate. Have anybody here stumbled on something that can be improved on the Wiki page. Post the suggestion here so we can improve our wiki.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

Yes, I've been keeping the tutorial framework up to date. It needs additional updates (for 1.10 and to correct include issues) and I hope to get that done this weekend.

What's interesting to me is that you started this thread, but didn't have a specific inaccuracy to point out yourself?
Ghelgason
Gnoblar
Posts: 6
Joined: Fri Jul 11, 2014 10:10 pm

Re: Can we improve the wiki tutorials?

Post by Ghelgason »

well a few weeks ago I installed the Ogre3d and ran into several barrier just because the installation guide i thought was not accurate enough. I thougt i could share my experience and improve the installation guide and the transition from installation to the first projects for the newbees.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

Which guide did you follow and which part did you have a problem with?
Ghelgason
Gnoblar
Posts: 6
Joined: Fri Jul 11, 2014 10:10 pm

Re: Can we improve the wiki tutorials?

Post by Ghelgason »

well i´m up and running now and have a little game project, but i followed first the guides here on the wiki page 'Installing the ogre sdk' and 'building ogre' etc.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

I hate to keep pushing on this, but you are asking people to help point out inaccuracies on the wiki ... which is cool ... yet I still haven't figured out which inaccuracies you encountered. That would be a good place to start, right?

So you followed both this:
http://www.ogre3d.org/tikiwiki/tiki-ind ... e+Ogre+SDK

As well as this:
http://www.ogre3d.org/tikiwiki/Building+Ogre

Are there any sections you can point to in there that need improvement or are inaccurate?
Ghelgason
Gnoblar
Posts: 6
Joined: Fri Jul 11, 2014 10:10 pm

Re: Can we improve the wiki tutorials?

Post by Ghelgason »

In the my installation proccess i downloaded the ogre sdk 1.9 and tried to innstall it. The installation did not succeed because i did not have the directX package installed. That problem is well documented and I installed the dirextX and installaed the ogre sdk again. The environmental variable was the next thing but that is also in the guide.
But what next. I tried to run program but it always fail to run with an error message and i thought that the installation had faild so i tried the other versions 1.8 and 1.7 but no luck same error and i could not run anything. Then i tried to innstall it on windows 8 machine(had been trying on Windows 7) and even ubuntu virtualmachine. You can imagine that i spent some hours trying to get it to work.

The instruction that I could select the samplebrowser and select: Set as StartUp Project and the run the sampleBrowser to see that my installation had succeed was not in the instruction and i thougt it should have been there so I've added some information in the 'installing the ogre sdk' guide in the wiki:

Open the solution Ogre.sln with Visual Studio and build the project(could take a few minutes). Then LEFT click on sampleBrowser and choose: ‘Set as startup Project’.
RUN SampleBrowser and you can explore all the samples that are included with the Ogre Solution.

and a screenshot
Ghelgason
Gnoblar
Posts: 6
Joined: Fri Jul 11, 2014 10:10 pm

Re: Can we improve the wiki tutorials?

Post by Ghelgason »

The reason for the post was if anybody who had tried to installed the ogre had similar experiance like me would like to share it. And if we could improve the wiki installation guides. :D
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

Seems more like "how to use visual studio" tips, but OK :)

Also in VS2010, to set a Startup Project you need to right click, while your instructions specifically say to left click. I think it's fair to assume by the time someone is preparing to use a C++ SDK the instructions don't need to be this specific. It's safe to assume the user understands the basics of their version of Visual Studio, otherwise they are going to have way bigger problems than setting a startup project.

EDIT: I should say though, good on you for updating the wiki pages. Not enough users make edits :)
Ghelgason
Gnoblar
Posts: 6
Joined: Fri Jul 11, 2014 10:10 pm

Re: Can we improve the wiki tutorials?

Post by Ghelgason »

You are correct sir :D Of course is it right click and i change it in the guide. I've used visual studio 2012 and visual studio express - the free edition, also I have use codeblock and anybody could probably use any 'ide' thay are comfortable with.
ranar
Kobold
Posts: 25
Joined: Fri Oct 18, 2013 4:50 am

Re: Can we improve the wiki tutorials?

Post by ranar »

I used this when 1.9 came out i think but now i guess 1.10 and 1.9 are merged so this tutorial doesn't work but I used this as the bones of my application so now i am going back to 1.8 so this works.
http://www.ogre3d.org/tikiwiki/tiki-ind ... ial6Source
And i know i should tell you the errors but i don't have it in front of me but i know for sure one of the problems was

Code: Select all

public Ogre::WindowEventListener
I copied the 3 headers over from what c6burns posted on my thread but did not fix this problem(fixed the one i had in my thread). so i was going to compile 1.8 to see if it worked

And is there a way i can get 1.9 with out the 1.10 in it like when i first came out because i did not have any problems with just 1.9 but 1.10 change some stuff.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

ranar wrote:And is there a way i can get 1.9 with out the 1.10 in it like when i first came out because i did not have any problems with just 1.9 but 1.10 change some stuff.
default branch is 1.10. v1-9 branch is 1.9. I am sure you are (or were) using 1.10 because of your issue with Ogre::BLANKSTRING vs Ogre::StringUtil::BLANK. Some things have changed about 1.9 since the initial RC but I don't think going backwards to 1.8 is necessarily the solution.

I updated tutorial 6 to work with both 1.9 and 1.10 so have another try and let us know. You can see how I get around the BLANKSTRING issue with simple preprocessor code.
ranar
Kobold
Posts: 25
Joined: Fri Oct 18, 2013 4:50 am

Re: Can we improve the wiki tutorials?

Post by ranar »

Well I thought I got v1.9 I cloned this

Code: Select all

http://bitbucket.org/sinbad/ogre/ -u v1-9
but when I used the tutorial framework I had to apply the changes for 1.10. I would just like to stick with v1.9 right now too.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

If you were using 1.9 then you wouldn't be missing StringUtill::BLANK. Use:

Code: Select all

hg branch
to check, and:

Code: Select all

hg update -C v1-9
to switch if necessary

The proof is in the pudding. Just look at the definition of StringUtil::BLANK here: https://bitbucket.org/sinbad/ogre/src/7 ... pp?at=v1-9

Then switch to default branch and watch it disappear :D
ImLucid
Halfling
Posts: 41
Joined: Tue Dec 24, 2013 1:38 am

Re: Can we improve the wiki tutorials?

Post by ImLucid »

OKay thank you c6burns you have been very helpful, now if i could bother you with one last thing? I was using that tutorial you fixed for the latest version the one here http://www.ogre3d.org/tikiwiki/tiki-ind ... ial6Source and I wanted to be able to move the camera and I know the tutorial framework has this in it but I understand the basic tutorial one better. So I think I am really close to figuring it out but im not for sure, here are the steps I took and still cant get keyboard input.

First I added this ontop of my header file.

Code: Select all

public OIS::KeyListener, public OIS::MouseListener
so now it looks like this

Code: Select all

class BasicTutorial6 : public Ogre::WindowEventListener, public Ogre::FrameListener, public OIS::KeyListener, public OIS::MouseListener
{
public:
     ....
I than added the OIS Listeners

Code: Select all

// OIS::KeyListener
    virtual bool keyPressed( const OIS::KeyEvent &arg );
    virtual bool keyReleased( const OIS::KeyEvent &arg );
    // OIS::MouseListener
    virtual bool mouseMoved( const OIS::MouseEvent &arg );
    virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
    virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
I than added the callback for keyboard and mouse

Code: Select all

mMouse->setEventCallback(this);
	mKeyboard->setEventCallback(this);
This next step is where it gets fuzzy for me I added

Code: Select all

bool BasicTutorial6::keyPressed( const OIS::KeyEvent &arg )
{
	if( arg.key == OIS::KC_U)
	{
		Ogre::LogManager::getSingletonPtr()->logMessage("*** Key Pressed 'U' ***");
	}
	return true;
}

bool BasicTutorial6::keyReleased( const OIS::KeyEvent &arg )
{
    return true;
}

bool BasicTutorial6::mouseMoved( const OIS::MouseEvent &arg )
{
    return true;
}

bool BasicTutorial6::mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
    return true;
}

bool BasicTutorial6::mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
    return true;
}
I dont know what to put in these but i tried if i pressed U it would ouput to the log but im not seeing anything in the log.

Here is the complete hpp file and cpp in case i missed something.

Code: Select all

/*
-----------------------------------------------------------------------------
Filename:    BasicTutorial6.h
-----------------------------------------------------------------------------
 
This source file is part of the
   ___                 __    __ _ _    _ 
  /___\__ _ _ __ ___  / / /\ \ (_) | _(_)
 //  // _` | '__/ _ \ \ \/  \/ / | |/ / |
/ \_// (_| | | |  __/  \  /\  /| |   <| |
\___/ \__, |_|  \___|   \/  \/ |_|_|\_\_|
      |___/                              
      Tutorial Framework
      http://www.ogre3d.org/tikiwiki/
-----------------------------------------------------------------------------
*/
#ifndef __BasicTutorial6_h_
#define __BasicTutorial6_h_
 
#include <OgreRoot.h>
#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>
#include <OgreWindowEventUtilities.h>
#include <OgreFrameListener.h>
#include <OgreTextureManager.h>
#include <OgreSceneNode.h>
#include <OgreLogManager.h>
 
class BasicTutorial6 : public Ogre::WindowEventListener, public Ogre::FrameListener, public OIS::KeyListener, public OIS::MouseListener
{
public:
    BasicTutorial6(void);
    virtual ~BasicTutorial6(void);
    bool go(void);
 
protected:
    // Ogre::WindowEventListener
    virtual void windowResized(Ogre::RenderWindow* rw);
    virtual void windowClosed(Ogre::RenderWindow* rw);
 
    // Ogre::FrameListener
    virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);

	// OIS::KeyListener
    virtual bool keyPressed( const OIS::KeyEvent &arg );
    virtual bool keyReleased( const OIS::KeyEvent &arg );
    // OIS::MouseListener
    virtual bool mouseMoved( const OIS::MouseEvent &arg );
    virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
    virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
 
private:
    Ogre::Root* mRoot;
    Ogre::String mResourcesCfg;
    Ogre::String mPluginsCfg;
    Ogre::RenderWindow* mWindow;
    Ogre::SceneManager* mSceneMgr;
    Ogre::Camera* mCamera;
 
    // OIS Input devices
    OIS::InputManager* mInputManager;
    OIS::Mouse*    mMouse;
    OIS::Keyboard* mKeyboard;
};
 
#endif // #ifndef __BasicTutorial6_h_

Code: Select all

/*
-----------------------------------------------------------------------------
Filename:    BasicTutorial6.cpp
-----------------------------------------------------------------------------
 
This source file is part of the
   ___                 __    __ _ _    _ 
  /___\__ _ _ __ ___  / / /\ \ (_) | _(_)
 //  // _` | '__/ _ \ \ \/  \/ / | |/ / |
/ \_// (_| | | |  __/  \  /\  /| |   <| |
\___/ \__, |_|  \___|   \/  \/ |_|_|\_\_|
      |___/                              
      Tutorial Framework
      http://www.ogre3d.org/tikiwiki/
-----------------------------------------------------------------------------
*/
#include "BasicTutorial6.h"
 
#include <OgreException.h>
#include <OgreConfigFile.h>
#include <OgreCamera.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreEntity.h>
#include <OgreWindowEventUtilities.h>
 
//-------------------------------------------------------------------------------------
BasicTutorial6::BasicTutorial6(void)
    : mRoot(0),
#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR < 10
    mResourcesCfg(Ogre::StringUtil::BLANK),
    mPluginsCfg(Ogre::StringUtil::BLANK),
#else
    mResourcesCfg(Ogre::BLANKSTRING),
    mPluginsCfg(Ogre::BLANKSTRING),
#endif
    mWindow(0),
    mSceneMgr(0),
    mCamera(0)
{
}
//-------------------------------------------------------------------------------------
BasicTutorial6::~BasicTutorial6(void)
{
    //Remove ourself as a Window listener
    Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, this);
    windowClosed(mWindow);
    delete mRoot;
}
 
bool BasicTutorial6::go(void)
{
#ifdef _DEBUG
    mResourcesCfg = "resources_d.cfg";
    mPluginsCfg = "plugins_d.cfg";
#else
    mResourcesCfg = "resources.cfg";
    mPluginsCfg = "plugins.cfg";
#endif
 
    // construct Ogre::Root
    mRoot = new Ogre::Root(mPluginsCfg);
 
    // setup resources
    // Load resource paths from config file
    Ogre::ConfigFile cf;
    cf.load(mResourcesCfg);
 
    // Go through all sections & settings in the file
    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
 
    Ogre::String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }
    // configure
    // Show the configuration dialog and initialise the system
    if(!(mRoot->restoreConfig() || mRoot->showConfigDialog()))
    {
        return false;
    }
 
    mWindow = mRoot->initialise(true, "BasicTutorial6 Render Window");
 
    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    // initialise all resource groups
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
 
    // Create the SceneManager, in this case a generic one
    mSceneMgr = mRoot->createSceneManager("DefaultSceneManager");
 
    // Create the camera
    mCamera = mSceneMgr->createCamera("PlayerCam");
 
    // Position it at 500 in Z direction
    mCamera->setPosition(Ogre::Vector3(0,0,80));
    // Look back along -Z
    mCamera->lookAt(Ogre::Vector3(0,0,-300));
    mCamera->setNearClipDistance(5);
 
    // Create one viewport, entire window
    Ogre::Viewport* vp = mWindow->addViewport(mCamera);
    vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
 
    // Alter the camera aspect ratio to match the viewport
    mCamera->setAspectRatio(
        Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
 
 
    Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
 
    Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
    headNode->attachObject(ogreHead);
 
    // Set ambient light
    mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
 
    // Create a light
    Ogre::Light* l = mSceneMgr->createLight("MainLight");
    l->setPosition(20,80,50);
 
    Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
    OIS::ParamList pl;
    size_t windowHnd = 0;
    std::ostringstream windowHndStr;
 
    mWindow->getCustomAttribute("WINDOW", &windowHnd);
    windowHndStr << windowHnd;
    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
 
    mInputManager = OIS::InputManager::createInputSystem( pl );
 
    mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, false ));
    mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, false ));

	mMouse->setEventCallback(this);
	mKeyboard->setEventCallback(this);
 
    //Set initial mouse clipping size
    windowResized(mWindow);
 
    //Register as a Window listener
    Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
 
    mRoot->addFrameListener(this);
 
    mRoot->startRendering();
 
    return true;
}
 
//Adjust mouse clipping area
void BasicTutorial6::windowResized(Ogre::RenderWindow* rw)
{
    unsigned int width, height, depth;
    int left, top;
    rw->getMetrics(width, height, depth, left, top);
 
    const OIS::MouseState &ms = mMouse->getMouseState();
    ms.width = width;
    ms.height = height;
}
 
//Unattach OIS before window shutdown (very important under Linux)
void BasicTutorial6::windowClosed(Ogre::RenderWindow* rw)
{
    //Only close for window that created OIS (the main window in these demos)
    if( rw == mWindow )
    {
        if( mInputManager )
        {
            mInputManager->destroyInputObject( mMouse );
            mInputManager->destroyInputObject( mKeyboard );
 
            OIS::InputManager::destroyInputSystem(mInputManager);
            mInputManager = 0;
        }
    }
}
 
bool BasicTutorial6::frameRenderingQueued(const Ogre::FrameEvent& evt)
{
    if(mWindow->isClosed())
        return false;
 
    //Need to capture/update each device
    mKeyboard->capture();
    mMouse->capture();
 
    if(mKeyboard->isKeyDown(OIS::KC_ESCAPE))
        return false;
 
    return true;
}

bool BasicTutorial6::keyPressed( const OIS::KeyEvent &arg )
{
	if( arg.key == OIS::KC_U)
	{
		Ogre::LogManager::getSingletonPtr()->logMessage("*** Key Pressed 'U' ***");
	}
	return true;
}

bool BasicTutorial6::keyReleased( const OIS::KeyEvent &arg )
{
    return true;
}

bool BasicTutorial6::mouseMoved( const OIS::MouseEvent &arg )
{
    return true;
}

bool BasicTutorial6::mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
    return true;
}

bool BasicTutorial6::mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
    return true;
}
 
 
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
 
#ifdef __cplusplus
extern "C" {
#endif
 
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
    int main(int argc, char *argv[])
#endif
    {
        // Create application object
        BasicTutorial6 app;
 
        try {
            app.go();
        } catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
            MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
            std::cerr << "An exception has occured: " <<
                e.getFullDescription().c_str() << std::endl;
#endif
        }
 
        return 0;
    }
 
#ifdef __cplusplus
}
#endif
Than i just need to figure out how to move camera but after that i can start rereading the tutorials for better understanding of ogre
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

I debugged your code and it's not using buffered input, which means your event callbacks never get called. Try this:

Code: Select all

mMouse->setEventCallback(this);
mMouse->setBuffered(true);
mKeyboard->setEventCallback(this);
mKeyboard->setBuffered(true);
The wiki tutorial framework uses OgreBites::SdkCameraMan for camera control. It's really handy and you might want to check that out.
ImLucid
Halfling
Posts: 41
Joined: Tue Dec 24, 2013 1:38 am

Re: Can we improve the wiki tutorials?

Post by ImLucid »

Thanks a lot, I got it working with input and I also got my camera to work with Ogre::Bites
User avatar
LinkoVitch
Gnoblar
Posts: 1
Joined: Wed Jul 02, 2014 7:43 pm
Location: Manchester UK

Re: Can we improve the wiki tutorials?

Post by LinkoVitch »

Hi,
I am pretty new to Ogre3D (as you can no doubt tell from the post count :) ), and as such have been making (and still am) good use of the Tutorials to help me get going. One thing I have spotted a few times are links to items that no longer exist (at least where the URL points). I was coming here to ask about updating the WIKI regards this.

The most recent cases of this have been broken links to object inheritance diagrams, I have subsequently found these diagrams in the documentation and wondered if I should go an perform a minor edit on the tutorial and update the link? Or should I be raising these edits for the page owner to update?
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can we improve the wiki tutorials?

Post by c6burns »

The documentation was updated recently so it's understandable some of those links broke. All of the links in google's search ended up breaking as well. I would say make those minor edits where you see fit, and raise any problems where you are unsure here or in the broken wiki links thread (which I thought was a sticky but cant seem to find) :)
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Can we improve the wiki tutorials?

Post by spacegaier »

Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Post Reply