Volte
2005.09.12, 07:56 AM
Hey there. I am looking to make a very simple program as to which I can move a camera around. I've done a few Tuts, but non of them really anticipate greater development. If I were to make a small 3D space in which I could rotate my view, how would the best way of setting up an OO structure be. I suppose the objects I would want would be similar to:
UI - User Interface displays relevant text such as view angle. Could send other objects to it at which point it would display it.
Camera - Really nothing, just the coordinates of the camera, and its viewing angle.
Could I do this? would this be the correct approach? Having a UI object, and a Camera object of which I both instantiate once in the main function? I am really not sure how OOP works in C++, lol I took a class a long time ago in HS, but we immediately dived into JAVA :shudder:
I make a file a class, which can be called as an object so I do something like:
class UI {
void UI () {
I declare stuff here, set up variables.
}
}
and that would be the extent of the UI class (besides other things that I would actually add rather than sudo code)?
What about the "main" file? if everything is a class, how does it know where to start? do I make a non-class file with a standard main function in it which from there I create all my calls? As I recall in Java, you created a file with the same name as your program. Is this the same case in C++ OOP?
I know, they're a lot of nobbish questions, but I promise you, get me past this part, and I am home-free. Also, if you don't feel like answering, at least direct me to a relivent tut. I'd be much appreciated (my C++ book doenst come in till 1-6 weeks Grrr Borders :mad:).
UI - User Interface displays relevant text such as view angle. Could send other objects to it at which point it would display it.
Camera - Really nothing, just the coordinates of the camera, and its viewing angle.
Could I do this? would this be the correct approach? Having a UI object, and a Camera object of which I both instantiate once in the main function? I am really not sure how OOP works in C++, lol I took a class a long time ago in HS, but we immediately dived into JAVA :shudder:
I make a file a class, which can be called as an object so I do something like:
class UI {
void UI () {
I declare stuff here, set up variables.
}
}
and that would be the extent of the UI class (besides other things that I would actually add rather than sudo code)?
What about the "main" file? if everything is a class, how does it know where to start? do I make a non-class file with a standard main function in it which from there I create all my calls? As I recall in Java, you created a file with the same name as your program. Is this the same case in C++ OOP?
I know, they're a lot of nobbish questions, but I promise you, get me past this part, and I am home-free. Also, if you don't feel like answering, at least direct me to a relivent tut. I'd be much appreciated (my C++ book doenst come in till 1-6 weeks Grrr Borders :mad:).