ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
opengl is used to render/display 2d/3d
opengl is often accelerated by special video hardware
opengl has a lot of special effects and stuff.
What I need to know:
when working with opengl do you use opengl to hold all the 3d information, such as 3dObject is at x:y:z, move Object from XYZ to xyz, in which case you can check for intersections (collisions) of objects, and all that jazz?
OR
Do you write your own 3d managements engine, your own 3d space manager, and your own 3d objects, then somehow pass that information to opengl when you want ti displayed?
opengl is used to render/display 2d/3d
hmm tempted to say yes to render, but ill say no (due to the way you have said it, but it all depends on what you mean)and no also for displaying. this is the job of another api such as sdl,glut,freeglut,windows.. opengl is often accelerated by special video hardware
yes
opengl has a lot of special effects and stuff.
what are you calling a special effect? if you mean its has lights then yes, if you mean it has a particle system then no.
What I need to know:
when working with opengl do you use opengl to hold all the 3d information, such as 3dObject is at x:y:z, move Object from XYZ to xyz, in which case you can check for intersections (collisions) of objects, and all that jazz?
hmmm what do you mean hold of the 3d info? normally you would create structures for objects, these structures have update, adjust position, draw func etc. Opengl does have fast transformations and rotations so that you can move "objects"; but it does not have any collision detection and all that "jazz" (whats music got to do with this lol).
Do you write your own 3d managements engine, your own 3d space manager, and your own 3d objects, then somehow pass that information to opengl when you want ti displayed?
All correct besides the passing to opengl, as I said at the top this is the responsilbilty of the api you are using to display to screen.
This is all helpful. bascially I really wanted to write my own 3d space management system, then some point later down the road actually worry about displaying it in a form other than text coordinates. But at one point later I will want to have the objects actually displayed in 3d on the screen.
What I am gonna write:
A class that holds 3d objects and lets you manipulate them, it will also allow you to check if objects intersect, or would intersect if moved a specific distance in a specific direction. rotation will also be here.
A class that holds a 3d objects, vertices, surfaces, motion.
a class that contains the 3d manipulator, it will take care of gravity/collision detecting, etc.
At the end: Have the last class I just specified call the proper library stuff to display the 3d information to the screen
now, am I correct in assuming I only need to use opengl (or other library that uses opengl) in that last class that 'puts the information on screen'
I have never done anything involving display or opengl or 3d as far as showing an image goes. However I have written small simple primative 3d managers. IK do not know the proper term, I have not taken classes or studied or read books on 3d, however I have written something that held objects in 3d space relative to a center point, could let me move and rotate those objects, and calculate distances betweent he closest points on each object. I have also programmed rhudimentary 3d object classes that held data for a 3d object including points and surfaces (all triangles). I did it once in java, then again in c++. However both those projects then stopped because I had no idea how to actualyl show the information on screen other than having it give the location of each point after a rotation or move and then verifying the new location against my hand calculations.
my problem is purely on the showing it on the screen side, not the programming the inner workings. I have almost no UI or GUI eperience except java awt, html and a LOAD of text interface. But I love data structures, algorythms, and the likes. I usually have a friend or contact program any advanced interface tot he backends I write.
is nice when you are trying to produce something, or get something done quickly. It is also nice because it lets you go directly to the end result.
However! I find that it can also be dangerous, for instance you did not ask me WHY I am doing this... I am not doing this for production purposes, I am doing this because I want to learn how, and figure it out, I want the challange, I am not worried about failing. Using someone elses would be a waste of my time because I am not necissarily gonna use it for something. How can I learn about the inner workings of a 3d engine if I use someone elses.. and btw, what would I use it for?
I bore easily, if I were going to try to learn by reading the code to another project I would stop after a couple lines from sheer boredom, I need to DO.
Also while it is a waste of time to keep re-inventing the wheel, it is also dangerous to overspecialise, if we only have 1 then a single event could take it out. Or a better example... Windows, if we did not do what was already done we would be stuck with windows, we already had a gui os, but no, someone wanted something else and bam we have linux, bsd, skyos, etc.
Now similar is happening with kde vs gnome, everyone says end one project and focus on another, I disagree! While there are definate benefits to focusing on one, I would hate to have only one to choose from, it woudl be as though one of my freedoms has been torn away.
I am not saying we should re-invent everything 100 time, I see the benefits of re-using what has been done. However I recommend you find out why someone is doing something over before critisising them. I am doing it in this case to learn how it is done. If you were say paying me to do something then your money would of course give you the right to demand I do not spend time re-iventing everything. but on my own time do not even think of telling me how to do things.
I asked a simple question, for my own purposes, do not critisize my for your conclusion of what I am doing based on a short message.
BTW, I use enlightenment and windowmaker, kde and gnome are both far to binding, I do not want to do things their way!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.