Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

davior

OpenGL 3D code producing program

This topic is 6926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all.. I just thought I might post an idea of a program I am working on, to see what people think about it, and to brainstorm the whole idea... I am currently working on a program which creates self contained OpenGL code.. I am wanting to eventually create a game which is based in a 3D world, but I don''t want to have to hard code the graphics and levels. Here is a basic example of how it works. For each object you want to create you input a number of parameters. eg. for a box/cube you only need Height, width and depth. From these 3 parameters it produces the code for the box, and displys it on the screen. So effectively, you have created a 3D object which normally uses 24 vertexs (or 72 coordinates), with only 3 variables.... Pretty cool hey? Anyway, I have inplemented this code and it works fine. I could quite easily include another 3 variables for the position of the object. So thats cool, but imagine the same concept applied to a complex series of polygons, like a room. You could have variables to include objects in this room like windows or doors. Enter height, width, depth, wall thickness, window?, doors? and BOOM goto "save as code" and there you have it. What is essentually written to file when saved, is a single function which contains information on all the objects created, thier position etc.. and all you have to do is call this function from your main program, compile and there you have it.... So basicly, in the end I will have a program, remeniscent of 3D Studio Max, except it saves in OpenGL code, instead of raw data.. What dya think of that? Any ideas?? I just thought that this was an idea worth sharing with others, cos the applications for a program like this one are endless.. Anyway I hope this simple idea gives others inspiration for thier programs. davior

Share this post


Link to post
Share on other sites
Advertisement
Not to be rude, but I think I will stick with my 3DS Max converter. 3D Studio makes it a lot easier to make complex as hell stuff. Still, I say go for it, because it will be a ''learning experience'' as I like to call it.

Pythius

Share this post


Link to post
Share on other sites
actually, i think 3ds max already does this (is that what you meant?). it saves the objects parametrically rather than as raw data.

a2k

Share this post


Link to post
Share on other sites
I think its a stupid idea. Why would you want to save as code - you'd end up with a nightmare of a program with millions of pointless lines of code. You should just do it the normal way and have a draw_object() routine with scale/position in the parameters. (or use glTranslate for position).

But before you do that, I suggest you learn how to make your coding more efficient, because its one of the most useful things you can learn in programming. If you want I can dig out and send you the source to my draw object routine and object structure.

http://www.geocities.com/ben32768

Edited by - benjamin bunny on May 8, 2000 12:25:36 PM

Share this post


Link to post
Share on other sites
u might want to consider using 6 varables - the original 3 plus 3 to store the X, Y and Z rotation.

just a thought.

MENTAL

Share this post


Link to post
Share on other sites
Just a question for you MR BUNNY.. Why <WOULDN'T &lg you want to save as code??? Any refinments could be made to this concept so as to not have to end up with "hundreds of lines of pointless code...." Personally I find concepts much easier to grasp if I know about everything that is going behind the scenes. This being the case I personally would find a tool like this to be very useful, and not limited in what it could produce. The code it could end up producing could be just as good if not better than the code you would produce in hours of hard coding. After all it would only be as good as the person coding it. So fine, if you feel this is such a stupid idea, but no amount of flaming is going to change my mind on it.....




Edited by - davior on May 8, 2000 2:03:36 PM

Share this post


Link to post
Share on other sites
Yeah, it does sound like a good idea to include parameters for rotation. The thing is, is that the applications are endless. You could include things such as animation, texturemapping, lighting, and the list goes on. Anything you could do in hard code you could reproduce again in a fraction of the time. With the right use of objects and structures you could evenend up with much more compact code...


Share this post


Link to post
Share on other sites
I think this kind of saving 3d data needs much more space than storing onlythe vertices and indices to them.

Visit our homepage: www.rarebyte.de.st

GA

Share this post


Link to post
Share on other sites
The code produced by such an application would take up MUCH more space than, say, storing polygon data in memory and using a for loop to draw them. With your method, the code size increases as the world size increases. With the typical method, code size stays the same regardless of world size.


Wraith
BasketQase Software

Share this post


Link to post
Share on other sites
I didn't mean to be rude. It's just that this simply is not the way to go about saving objects. Source code is for producing programs, not 3D models.

The correct way to go about saving objects is to save all relevant information (position, vertices, normals, lighting, texture coords) in an object structure, and then draw the object from that.

btw, if you're going to quote me, at least get it right. I actually said "millions of pointless lines of code" not "hundreds", and its not an exaggeration either.

http://www.geocities.com/ben32768

Edited by - benjamin bunny on May 8, 2000 3:33:00 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!