As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new to OpenGL.
Wondering if there is any good Scenegraph API/framework for OpenGL.
At the moment I am using glut with a custom node based solution: I am setting children and siblings for each node the calling a traverse function.
I'd like a more flexible solution when it comes to managing dynamic elements in the scene.
SDL is a bit more up to date than glut, but you are on the right track with rolling your own graph structure to manage scenery. There are plenty of frameworks available. OpenSceneGraph, for example, has been around for quite awhile now. OGRE has a large following as well. However, it is not a strictly OpenGL library as DirectX and software renderers are also available.
You may want to look into related topics like binary space partitioning, quadtrees/octrees and kd-trees.
I agree that openscenegraph is a great scenegraph. It is written i C++ and has bindings to some other languages, but not for .NET as far as I know. We were in the situation to use something more than plain old opengl and were looking at managed directx, xna, wpf and opengl. We chose to write our own scenegraph based on Tao.OpenGL as opengl.
You can accomplish dynamic objects by having an update phases before the culling and rendering stages. If you do multi-threaded you need to be careful with the update stage.
There are plenty of libraries treating this topic. Here some of my favorites:
VTK - extremely suitable and open source
Coin3D - very good commercial scene graph
OpenSG - just for completeness :-)
I second (third?) the use of OpenSceneGraph. It is robust and cross platform, and integrates well with Qt (our application runs on MacOS, Windows, and Linux using OpenSceneGraph and Qt together). The documentation may not be as polished as a commercial option, but there's a book you can buy (and a free Quick Start Guide) that really helps.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
For a single C++ programmer, how long should it take to write a GUI framework from scratch?
Rough specification:
You have access to boost, image loading functions, font rendering routines, signal-slot, unicode string classes, varaint classes. (basically Qt 4 minus actual gui (everything derived from QWidget)).
You'll have to implement standard controls like treeviews, table views, text editors, list box, combo box, buttons, radio buttons, panels, etc.
The framework is separated from operating system and does not use any OS objects (window handles). I.e. you operate on raster image or on OpenGL window and receive mouse/keyboard events from OS you have to dispatch/interpret.
There are multiple windows that can be moved/minimized/maximized, brought to front.
It should be possible to use the library to reimplement any rectangular window using this library (think Win98 gui with animation effects disabled).
You are not required to display html pages.
You can't cut corners, make bitmap in ms paint, blit it onto screen and say "it is a window". Components have geometry, configurable color, can be resized, "anchored" to different sides of the window, linked to each other and affect each other's sizes and geometry (think Qt 4 layout system).
Programmer's skill - average to above average, at least 3 years of C++ experience.
Basically, "Windows desktop" without using windows gdi.
I am asking because I'm working for guys that develop something like that from scratch (their needs are very unusual, and afaik no existing gui framework I know matches them), and I have a suspicion that I might be working too slowly, which negatively affects my "morale".
Previous people wasted 3 years on this project (they wrote it in Delphi) and have failed to complete it, so the guy in charge decided to scrap it and start over from scratch. Project is very different from traditional guis, but should have somewhat identical complexity.
So I need a rough estimate (with arguments or based on work experience) from another programmer for comparison.
My estimate is that it would take around 1 year or longer, but I'd like to know whether that is too long.
According to Wikipedia, development of Qt began in 1991 with two developers. They founded Trolltech in 1994. The initial Qt release was one year after in 1995, so it's at least 2 man years at full time (1994-1995) plus any time they spent on it before 1994.
The thing is, when they founded Trolltech, they probably already had a decent-enough product to take the financial risk of a company so those 2 additional man years are just the tip of the iceberg. And depending on the investment they were able to leverage, they may have hired other people to help them, too.
Even if you take into account all the core functionality that isn't GUI-related (the easiest part to write, IMO) and use a very optimistic estimate, that's still several man years for the initial GUI-part of Qt. Quite far from the 3 months your boss expected from you...
I would say that, given you invest a week of time planning the structure of the library and gathering together all of the features you want to include in it, you could potentially complete it in 6 months. This all depends on the amount of extensibility you want for it, but I think a year is too long.
This, of course, is all under the assumption of several years of experience with C++ and some experience in GUI design. It would also benefit the resulting look-and-feel if you or a co-worker had experience with graphical design in something like Photoshop to create the various UI skins.
I hope this helps.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I want you to help me for a decision problem.
I am a newbie video game programmer. I can develop Flash, Unity, Android games, and I know a little CryEngine. Also, I want to develop 3D video games in the future.
So, I decided to learn a video game library that I can work with C/C++. But should I learn Allegro or OpenGL or a different library? Or should I directly start to learn DirectX programming? Learning Allegro programming is useful (a good basis) or just a waste of time?
But should I learn Allegro or OpenGL or a different library?
First and foremost: OpenGL is not a library! The 'L' of it once meant library, but it's better to backronym it as "layer", because that's what OpenGL really is these days: A layer between your program and the graphics hardware.
OpenGL is not a game engine, it's not a game graphics library. OpenGL is a low level drawing API. You can use it to draw points, lines and triangles in fancy ways. But there's no scene, no objects and such in OpenGL. All this must be implemented by the game engine. Writing a game engine is very hard work. If you really want to go for this, I suggest you look at the source code of Doom3, which has been released a year ago.
Allegro has almost nothing to do with OpenGL.
Allegro is a basic framework for simple game development providing rudimentary 2D graphic primitives, user input, text, sound, timers, etc... You can use OpenGL under Allegro, but there is no tight and specialized integration.
OpenGL is a low level API, specialized for graphics.
If you already know Unity and CryEngine, stick to them. It would be a tremendous difficulty to implement even a fraction of their features using OpenGL on your own. That doesn't mean you shouldn't learn some OpenGL, even for the sake of curiosity and understanding how stuff works on the low level.
DirectX is platform limited, and while it is true the majority of gaming platforms do support DX, ARM mobile platforms are on the rise, and DirectX doesn't run on them. OpenGL can match pretty much everything D3D has to offer, and it is more portable, so it is the API that is more worth investing in, unless you are centered on Windows games exclusively. Then it would make sense to learn D3D, which is a little easier to use.
Many game engines, including Unity, will abstract away from the graphics API and use the best what the target platform provides.
Also, keep in mind that OpenGL is not available on Windows 8 in "metro" mode, so you will either have to use D3D if you want advanced graphics under metro mode, or use ANGLE and stick to more basic subset of OpenGL that is emulated with ANGLE on top of D3D.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to use Qt for a non-UI application. It has the potential to run on an appliance, but will start out on the desktop. The UI part (I know, I said non-UI) would be a web server with HTML(5)/AJAX.
I would really only use Qt for basic cross platform stuff like threads, synchronization, serialization, resources (strings, maybe images), internationalization, etc.
Which would be better for something like this, Qt or Boost and creating the cross platform layer myself?
Qt feels a little heavy for what I need, but I want to hear what experiences others have.
Yes, in my opinion it is perfectly OK. I wouldn't say Qt is heavy compared to Java, for example, which is extremely widely used for such tasks. Qt is very powerful, clean, easy and fast. I use it a lot, and I don't know any major drawbacks with it.
Yes, using QtCore (and other non-GUI modules) should do just what you need. As choosing between Boost and QtCore: both do good jobs and sometimes they interleave. But not always.
Qt(Core) offers mainly functionality. Boost offer mainly tools to achieve functionality. For example, you have templates and functors in Boost, not in Qt. OTOH, if you need message pumps and the like, you will only find those in Qt.
It really depends on what you are trying to achieve.
What you're proposing is perfectly reasonable.
You want to use a number of features (threading, etc. that you mention) across platforms.
Essentially you have a number of options, as follows:
Option 1 (Bad): Write your own cross-platform wrappers. You'd be reinventing the wheel, and you probably won't be able to tackle as many cross-platform cases and features as Qt already does. This option also means that whoever inherits your code will have to deal with your custom library instead of a well-supported and well-documented easily accessible library.
Option 2 (Not recommended): Use individual cross-platform solutions for every feature you want, like threading, networking, etc. This means that you (and your successor) will have to maintain compatibility with a large number of libraries in the future.
Option 3 (Recommended): Use a single, well documented, easily accessible library to meet all your needs. Qt fits the bill.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am a total Beginner in C++ and programming generaly.
I have watched a couple of hours tutorals of C++ and read alot about it (Could you recommend some tutorials?), but what I´ve come across and couldn´t understand was Librarys.
I want to develop games in C++ (I think, it seems most interesting atm).
I can understand that I need a library for game programming in C++, but I don't know much about what a library is specifically, and where to find these librarys.
Also, I´ve read that Lua should be good to script the games with. I would like to know if this is true?
If its true, I would like to know where to find tutorials for Lua?
If not true, what is good then?
Thank you for your time.
This is my first question here.
I apologise if it wasn´t a proper question for this website, or if the english was bad.
I still hope you can give me some kind of answer and/or response.
You may want to try out Löve2d, a framework across Windows, Linux, and MacOS X for writing games in Lua. It bundles various game libraries for sound, graphics, physics etc so that you don't need to deal with that directly, and it lets you focus on the writing of games.
A good library to get started with game programming is SDL. http://lazyfoo.net/SDL_tutorials has some great tutorials to help you get started (the most comprehensive and easy to understand that I've found), but you need to understand program structure and such to get some practical use out of the tutorials.
OpenGL is pretty standard for 3D game programming, but it's more advanced than SDL. I'd recommend making sure you understand at least basic C++ before you move on to game programming... http://cplusplus.com/doc/tutorial would be a good place to start.
Here you can get very good and complete video tutorial of cs Indian institute of technology
I'm sure someone will come along and post an essay answering your questions in more detail, but here are the short answers.
A library is nothing more than a reusable collection of code. People write code and package it up for other people to use in their own projects. Libraries you would need for games include libraries that handle graphics, audio, networking, font/image loaders, etc.
Lua is great to script games with. It integrates very nicely with C/C++. Visit Lua's home site for tutorials.
Check this link out http://cplusplus.com/doc/tutorial/ for libraries here is the STL http://cplusplus.com/reference/.
Here is a reference on Lua, http://lua.gts-stolberg.de/en/index.php?uml=1.
can understand that much that I need a library for game programmig in C++, but I dont know much about, what A library is specificly, and where to find these librarys.
#TheBuzzSaw already answers what a library is, so I'll answer where to find. But wait, before WHERE, you have to know WHAT library to use. There are a lot of game libraries out there, both low level (loosely coupled between components) and high level (tightly coupled). The low level ones have separate functionality for graphics, sound, AI, etc. processing and usually each functionality can be used for things other than games. While the high level ones "glue" them together to form something that's ready to use as a whole (for instance, it provides scene class with events, music, etc. you just have to set some values to use). Due to the many number of then, I can't really say where to find before you know which one to use. One quite complete one is SDL, it's a low level one. Allegro is another one.
Also, I´ve read that Lua should be good to script the games with. I would like to know if this is true? If its true, I would like to know where to find tutorials for Lua? If not true, what is good then?
Lua is good, and it's used a lot in games. Ruby is good, some games use it. Python is good as well. Basically, most scripting languages are good for game scripting. You just have to consider what language features your game required, how fast you want it to be usually contradict with its syntax flexibility, etc.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I just purchased the fifth edition of the OpenGL SuperBible. I'm very pleased that they've avoided using deprecated functionality but their examples make use of GLTools. GLTools provides a slew of useful functions for rendering simple 3D objects and managing the view frustrum, camera, and transformation matrices.
This is all great but the abstraction provided hides low-level details and I'm having difficulty moving to code where I can't use GLTools -- for example, pyopengl. The vast majority of tutorials I've seen online make use of immediate mode, which I'm trying to avoid. Those that use glDrawArrays make use of glEnableClientState, which I'm also trying to avoid.
What I'm looking for is introductory tutorials that are fully OpenGL 3.x compliant. If that's too tall of an order, perhaps a laundry list good "starting point" functions would be in order.
Stay away from NeHe, the tutorials are hopelessly outdated and contain a lot of "problematic" stuff, too.
For starting with 3.x, try those, they're both up-to-date:
Aurian (Joe Groff)
Arcsynthesis (Jason L. McKesson)
Update:
Re-reading my own post almost 2 years later, I guess that one might find that it sounds a bit harsh.
This is of course not the intent. The core message (which remains valid) that I wanted to give was that NeHe still deals with OpenGL 1.x/2.x and uses some unsupported "antique" libraries.
Generally, as such, this does not mean the tutorials are necessarily bad, but starting from there will mean starting two generations behind the current state-of-the-art, and one generation behind the minimum one should learn. Learning legacy OpenGL will, at a later time, require you to forget almost everything you know and re-learn from scratch.
That said, the NeHe front page now links to a tutorial focussed on OpenGL 3.3 by Damien Mabin, which looks quite nice at first sight (though I will not have time to thoroughly read through it before new year).
https://bitbucket.org/rndblnch/opengl-programmable
a short step by step tutorial to OpenGL programmable pipeline (OpenGL / OpenGL|ES 2.x) for people already familiar with the fixed pipeline. dependencies: python 2.5+, PyOpenGL 3.0.1+
Successive versions of a small but rather complete glut/opengl program that starts from direct mode and is transformed step by step to run exclusively on the programmable pipeline.
Look at the diffs between successive version to have an highlight of the changes needed (e.g., https://bitbucket.org/rndblnch/opengl-programmable/changeset/b21131e37ed7).
Here is a serie of OpenGL 3.3 tutorials for Windows, that doesn't use any of deprecated functionality, only new stuff:
Megabyte Softworks OpenGL 3.3 Tutorials