Creating 3D software C++ [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a project to do where I'm asked to create my own little 3D software in C++.
I'm not sure where to start from, I thought I might go with OpenGL 3.3, which i need to study first, and make it all accessible through a GUI ?
Is it the right way to process ?
I've used 3D softwares like Blender, and all I want to do is something really basic :
buttons to create primitive object
move them
rotate them
scale them,
maybe a bit of texturing and lighting

You can check out this tutorial:
http://www.codeproject.com/Articles/20286/GLUI-Window-Template#_articleTop
or
You can look at mine I did for a school project.
https://github.com/sitting-duck/stuff/tree/master/School%20-%20Comp%20Sci/Computer%20Animation%20-%20Fall%202014/Assn1%20-%20Transformations/assn1%20redo/assn1
In this version I just use key bindings to initiate the transformations. Will be easier than making a GUI, so I did that first to learn how to get the transformation code all working,
when you open it it's going to complain that it's missing libraries (like freeglut.lib) because I didn't upload them to github. The reason I didn't upload them to github is because those libraries are going to keep being updated, so if I want to use this project I will just go redownload the latest versions.
You would have to go get those libraries and link them to your project. You would also have to make sure the glew library is installed on your computer, so it will be a little more complicated than just copying my code to get it running, but at least you can look at mine and try to get an idea of what's going on.
I used the GLUI library for user interfaces, all the buttons and stuff usually, it's been a while since I've used this and there are probably other libraries that are better but I found GLUI to be pretty easy, I've also heard of ANTTweakBar being used for GUI stuff,
I have another project with more user interface stuff, but I'll have to find it and go upload it,
hopefully I gave you enough hints to where you can get up and running, you can see in my code what libraries I am using and go to the library websites to learn how to install them, link them to the project etc.
Here's some keywords, glew, glut, freeglut, glui, ANTTweakbar go look up those things,
also, you won't need to use Blender to make a model for your program, OpenGL already has some primitives built in that you can use to test out your transforms on.
probably with your current state of knowledge you won't be able to run and compile my project and unfortunately I did not post any instructions on my github :( but an example I'm sure will help you and when I finish some other work today I will go post installation instructions on there.
I made this using VisualStudio 2013 on Windows 8.1. You may need to use older versions of the glew and glut libraries if you are using older version of VisualStudio,

Related

Displaying an image and its metadata in C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am learning Linux programming using C++. As a project I want to make program that would pop up a window and display the image (passed as arguments), with the meta data of the file.
I have looked up the OpenCV library, and I would like to build something similar but simpler, on my own. Basically I want to implement just this kind of functionality. How should I go about doing this?
For a start, I will be working only with .jpg files.
the popup window part can be happen by QT or SDL
or many other GUI framework and you should consider GTK too. simple image operation can be done by these too, but for more advance topics you can go for example to Imagemagick library
QT sample : http://doc.qt.io/archives/qt-4.8/qt-tutorials-widgets-toplevel-example.html
SDL sample : https://wiki.libsdl.org/SDL_CreateWindowAndRenderer
also reading metadata in qt can be done using QImage or QImageReader and methods like QImage::textKeys() or QImageReader::textKeys()
If you want to implement it from scratch, you must know a few things
Binary I/O (C++ provides that easily)
How Images are stored in computers, what's the difference between different formats like .jpeg and .png - how they encode and compress pixels ?
How to Draw anything on your screen ? there are many options Using a GUI toolkit canvas, X11 windowing system drawing abilities or even use something like OpenGL or DirectX.
Or just simply use any of the libraries mentioned by #nullqube
Qt framework could definitely make your project easier.
It would also allow you to easily display a file dialog window to let the user select the file, rather than passing it as an argument to the program.

fast way to get graphic output in c++ eclipse

Im currently working on an excercise about lagrange interpolation. I'm on the point where i would like to plot my data. So I thought there must be a quick and easy way to generate a window and draw some points in eclipse.
Well seams like I thought wrong. I searched on google and I found a shitload of different libarys, all of them either outdated, useless or with a really long installation guide.
The graphic output is really just to test my interpolation, so I want to spend as less time as possible with it. I remeber that there was a libary for java which was pretty simple. You could just import the libary, make a command to initialise a window, and then draw in it. There was no need for a installation and going from zero to a window with a circle was about three commands.
Is there really nothing like that for C++? What could I do to keep it as simple and fast (to install) as possible?
Thanks
Is there really nothing like that for C++?
Not really. C++ includes the "standard library" and that's it. The functionality you're looking for is provided by third-party libraries, as you've already found.
Asking for library recommendations is specifically off-topic on StackOverflow, by the way.

Using Google Chromium's Views Project as an Application Framework in C++ [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have had contact with Google Chromium Code and that’s terrific for building applications with. The problem now lies that no-one has tried to use it outside Google Chromium Project. What I have in mind is to develop an open source project which may be used for this purpose. The fundamental goals would be:
Guarantee Linux-Windows support for the same code.
Take advantage of all resources available like thread control, stats, unit test…
Make it clearer how to use Skia for graphic effects and customizations.
Present a useful application doing the most of this.
Integrate C++ and JavaScript code using V8
Use Webkit for rendering html content
There’s a chance of it get off the paper. What do YOU think?
Claudio M. Souza Junior
Developer.
see https://github.com/lianliuwei/chromium_base
I create it for the same reason like you.
chromium is great project. It's code could be useful to using in other project. but It need time to extract it. I see one project to extract the ui part, but it change too many for noreason for example it change the .cc to .cpp. my project extract the base, ui, view part for the origin project, rm the ICU (it's so big) and gurl(you can add it quick) keep the gyp, gclient, grit-i18n, gtest, gmock... change the code little. and keep the extract history. I add a new type of messageloop for using it in the MFC(for company project :( ) now it can only work on Windows but it's no so hard to make it work on linux.(google do it all)
for use the browser in you project you can see the http://code.google.com/p/chromium/ for help.
It's great this project help you a litte. I at first think it's a no one care project.
I'm assuming you have looked at the extensively documented and developed QtWebkit and know why you don't want to use that?
I'm sure it will be easier to use V8 in a QtWebkit application than to somehow tear out Chromium's "View project".
Qt has the bonus that as long as you operate within the framework, everything will work on a lot of different platforms (more than Chomium now supports I think).

What disadvantages could I have using OpenGL for GUI design in a desktop application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
There are tons of GUI libraries for C/C++, but very few of them are based on the idea that opengl is a rather multiplatform graphics library. Is there any big disadvantage on using this OpenGL for building my own minimal GUI in a portable application?
Blender is doing that, and it seems that it works well for it.
EDIT: The point of my question is not about using an external library or making my own. My main concern is about the use of libraries that use opengl as backend. Agar, CEGUI or Blender's GUI for instance.
Thanks.
Here's an oddball one that bit a large physics experiment I worked on: because an OpenGL GUI bypasses some of the usual graphics abstraction layers, it may defeat remote viewing applications.
In the particular instance I'm thinking of we wanted to allow remote shift operations over VNC. Everything worked fine except for the one program (which we only needed about once per hour, but we really needed) that used an OpenGL interface. We had to delay until a remote version of the OpenGL interface could be prepared.
You're losing the native platforms capabilities for accessibility. For example on Windows most controls provide information to screen readers or other tools supporting accessibility impaired users.
Basically unless you have a real reason to do this, you shouldn't.
Re-inventing the Wheel: Yeah, you'd be doing it. But I note OP used the word "minimal" in the problem statement, so assuming it really doesn't need to scale up to all that, it may be a small enough wheel as to not matter. The product I currently work on supports OpenGL on three platforms (Win, Mac, Linux) and we built all our own widgets (text boxes, buttons, dialogs). It's a lot of work but now that we've done it we own a huge chunk of our stack and don't have to debug into third party frameworks when things don't work as expected. It's nice having complete control of the experience. There's always something you want to do that a framework doesn't support. Like everything in our business, it is a trade-off and you just have to weigh your needs against your need to finish on time.
Portability: Yes, you will still have to write platform specific code to boot-strap everything. This will be difficult if you've not done it before as it requires you to understand all the target platforms.
Windows Drivers: We've found that graphics card manufacturers have much better support for DirectX on Windows than OpenGL, since that's what is required to get MSFT certification. Often low- to mid-range cards have bugs, missing functionality, or outright crashes in their OpenGL support.
With Qt 4.5 you can select if you want to use OpenGL as window renderer.
More info:
https://www.qt.io/blog/2008/10/22/so-long-and-thanks-for-the-blit
Read the comments to know about the problems about this.
The obvious one is that you're basically building the GUI elements yourself, instead of having a nice designed like for wxWidgets or Qt.
You cant just use opengl, you need a platform specific code to set up a window for opengl.
From the freely available opengl red book:
OpenGL is designed as a streamlined,
hardware-independent interface to be
implemented on many different hardware
platforms. To achieve these qualities,
no commands for performing windowing
tasks or obtaining user input are
included in OpenGL; instead, you must
work through whatever windowing system
controls the particular hardware
you're using.
There are multiplatform solutions for this like glut, qt, wxWidgets, ...
And if you have to use them anyway, why not use built in GUI elements. They also give you the opportunity to build your own, and make use of the framework to handle mouse/keyboard events and stuff.
If you want a GUI as in windows/button etc. Don't do it yourself. There a lot of free solutions for this, wxwidgets,qt or GTK. All have OpenGL support if you want a 3d window

GUI system development resources? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?
Currently my biggest influence is 3DBuzz.com's C++/OpenGL VTMs (Video Training Modules). While they are very good, they cover a large area of graphics programming, so only skim the surface of GUI programming.
This question does relate to "How do I make a GUI?", where there is also a rough outline of my current structure.
Any response would be appreciated.
Edit:
I've just read some of the answers and spotted that I've missed some points. I had to type the question twice as I caught the wrong button and lost it.
I missed two important points, first: This will be used cross platform including homebrew on a Sony PSP. Second: I want to create a GUI system not use an existing one.
Edit 2: I think some of you are missing the point, I don't what to use an existing GUI system I want to build one.
Qt in it's current form is not portable to the PSP, never mind the overkill of such a task.
That said I've decided to create an IM-GUI, and have started to prototype the code.
I wouldn't use OpenGL for the GUI unless you are planning for hardware accelerated and/or 3D effects that you don't think you would get with a more traditional GUI toolkit (e.g Qt, wxWidgets, GTK, etc). If you just need a quick simple GUI for hosting your OpenGL graphics then FLTK is a nice choice. Otherwise, for rendering the GUI directly in OpenGL their are libraries like Crazy Eddie's GUI that do just that and provide lots of skinnable widgets that you won't have to reinvent. The window and OpenGL context could then be provide with a portable library like SDL.
EDIT: Now that I've gone back and taken at look your other post I think I have a better understanding of what you are asking. For a GUI on an embedded system like the Nintendo DS, I would consider using an "immediate mode" GUI. Jari Komppa has a good tutorial about them, but you could use a more object-oriented approach with C++ than the C code he presents.
http://www.fox-toolkit.org has an API reference, if you're looking how to work with a specific framework. Or were you more interested in general theory or something more along the lines of how to do the low-level stuff yourself?
For more information about "immediate mode" GUI, I can recommend the Molly Rocket forums. There's a good video presentation of the thinking behind IM-GUI, along with lots of discussion.
I recently hacked together a very quick IM-GUI system based on presentation on Jari's page, and in my case, where I really just wanted to be able to get a couple of buttons and boxes on the screen, and more or less just hard code the response to the inputs, it really felt like the right thing to do, instead of going for a more full blown GUI-architecture. (This was in a DirectX-application, so the number of choices I had was pretty limited).
One of the fastest ways is to use python with a gui binding like pyQt, PyFLTK, tkinter, wxPython or even via pygame which uses SDL.
Its easy fast and platform independent.
Also the management of the packages is unbeatable.
See:
http://wiki.python.org/moin/PyQt
http://www.fltk.org/
(tkinter is default and already packaged with python)
http://wxpython.org/
http://www.pygame.org/news.html
For a platform like the PSP, I'd worry slightly about the performance of an IM GUI solution. With a traditional retained mode type of solution, when you create a control, you can also create the vertex buffer/display list or what-have-you required to render it. With an immediate mode solution, it seems to me that you'd need to recreate this dynamically each frame.
You might not care about this, if you're only doing a few buttons, or it's not going to be used in-game (assuming you're making a game) but, especially if you have a fair bit of text, the cost of rendering might start to hurt if you can't find a way to cache the display lists somehow.
Have a look at Qt. It is an open source library for making GUI's. Unlike Swing in Java, it assumes a lot of stuff, so it is really easy to make functional GUI's. For example, a textarea assumes that you want a context menu when you right click it with copy, paste, select all, etc. The documentation is also very good.
I'll second Qt. It's cross platform, and I found it much easier to work with than the built in Visual Studio GUI stuff. It's dual-licensed, so if you don't want your code to be GPL you could purchase a license instead.
I've had a look at the Video from Molley Rocket and Looked through Jari Komppa's cached tutorials.
An IM-GUI seems the best way to go, I think it will be a lot more streamlined, and lot quicker to build than the system I originally had in mind.
Now a new issue, I can only except one Answer. :(
Thanks again to Monjardin and dooz, cheers.
thing2k
I'd have a look at GLAM and GLGooey