Suggestions about building a custom camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Suggestions about building a custom camera

Post by geckoman »

Ok, just to be clear, I do not ask for code!

I want to CREATE (not copy/paste) a RTS-like Camera, but I don't know which is the best way.

- create own camera like the one in the Wiki (that don't work with 1.5 even after corrections from me)
- create own camera based on Maya Camera (is it less work than the solution above?)
- create a wrapper around a standard-cam with an IEventReceiver

Atm. I would prefer the last solution, because I don't want to handle inputs on more than one place.
What do you think?

The reason I want to create an own cam is, that it should be not exactly an RTS-Cam but ver much like it.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Use a scenenode animator
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

You have two possible ways: Inheritance or Composition.

In case of inheritance you have to base your camera on ICameraSceneNode which is mere interface so you need to implement everything yourself from scratch. Or you can copy and paste code from CCameraSceneNode and other camera scene nodes which inherit from it like CCameraFPSSceneNode. You can't inherit from them directly.

In my opinion composition is much more practical in this case. Just enclose one of the Irrlicht camera nodes inside new class and provide functions and controls you need. I did it myself and it worked very well.
sjb
Posts: 19
Joined: Tue Dec 23, 2008 10:35 pm
Location: Sweden

Post by sjb »

I would have opened up the source and just search for maya. There you will find how it's all inerhited and what you need for your own camera. :)
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

@sjb I did that, but the code is not the problem here as I mentioned, but the right way.

Btw. thanks for your help, I think I will use the animator or the composition then.
Post Reply