Posted on 2004-09-18
Last Modified: 2013-12-26

In response to a question entitled
"Not 3D game.. but 3D rendering"

spilocke at

Well, what I am trying to say here is I can see 2 clear parts to your program.
1. The modeller
2. The renderer

You can use OpenGL for the interactive modelling part. The user will be able to
place chairs, cups and tables in the virtual 3D environment. You get to see your
house with texture and shadows but the renderings produced are not accurate and
game like. You can stop here if you want to. But if you want to further on, then
just grab the info produced by OpenGL, translate it to Povray format and pass it
to povray to render it out. Here you get a nice accurate shadows, textures,
reflections and other stuffs.

I have a somewhat similar problem. I want to quickly place objects in 3D space (the openGL part), but then get a photorealistic version via Povray.

What I don't understand is
"just grab the info produced by OpenGL, translate it to Povray format and pass it
to povray to render it out"

What is "the info produced by OpenGL", how do I "just grab it" and how do I "translate it to Povray format".?????

I assume that the process does not involve translating a zillion calls to glVertex?

Question by:Mutley2003
  • 2
LVL 17

Accepted Solution

davebytes earned 500 total points
ID: 12096239
I don't know the POVRAY format(s) myself, though I seem to recall an ASCII text file with the raw scene data.

Basically, I'd suggest you'd want to be using vertex arrays, not display lists or immediate mode calls (like no glVertex).  That way, all of your souce modelling data is stored in YOUR own data structures in a form ready to be written out easily -- though in theory, you could have your data 'well organized', but still use immediate mode (glVertex) calls to render things, just slower... ;)

However, I'd start asking questions like:
- why are you writing this
- who is your target audience
- what quality level of output are you looking for
- do you need ray-traced results, or would shader-enhanced realtime results be just as good?
- do you want realtime flythrough of a high quality world, or static still-frame snapshots from a very-very-high quality world?

The main problem is that you will be basically writing an 'exporter' from your data/file format to POVRAY.  Forget that OpenGL is even involved for the moment.  Think of the data you will have (vertices, triangle sets, textures on triangles, light sources, maybe shaders, your own definition of 'objects', etc.), and how you will store it for your application.  Editing/Rendering it is a secondary task for the moment (should of course be kept in mind, so you don't create yourself a problem for optimal rendering/editing!  but bear with me...).

Once you know how your data is stored, you could write a program that converts it into an output file for POVRAY.  This could be a commandline program, or in-memory 'exporter' from your application.

Or, you could also embed a small ray-tracer or radiosity scanline renderer (likely many open source projects out there) into your application as a second rendering method.  Try to keep your modelling data separate from the actual rendering of that data, and you can plug and play different rendering approaches.


Author Comment

ID: 12096540
some insightful comments, as usual. thanks.

To answer your questions
- why are you writing this
profit, and fun
- who is your target audience
- what quality level of output are you looking for
very high .. "knock your socks off". But some aspects could be lower quality

- do you need ray-traced results, or would shader-enhanced realtime results be just as good?

That I don't know. If "shader-enhanced realtime results" are nearly to raytracing standard, then that gives me the best of both worlds. But I don't know enough about shaders.

- do you want realtime flythrough of a high quality world, or static still-frame snapshots from a very-very-high quality world?

Both, ideally. OK, I will back up a bit and explain. I am new to 3D graphics but not new to data analysis - this is a data visualization product. So there is SOME role for flythrough (although it can be slow, more walking than flying) . And SOME role for very-very-high still snapshots that can be printed in large format (A3 or poster)

I started wandering through OpenGL and got some results using an OO framework called VisIT, programmed in Delphi, that hides much of the low level detail - I am not sure they even have shaders. I was not entirely happy. Then I chanced across POVRAY .. very nice images and an accessible language.  But I get the impression from your comments that it is maybe "old hat".

Vertex arrays ? I guess I will have to go back to nehe but my first impression is that it is a huge amount of work. If I understand you correctly, you are suggesting that if I want a sphere in my scene (or worse, something more irregular), I need to build a class that will do all the geometry to represent that as a collection of vertexes!! AAAGH!!
LVL 17

Expert Comment

ID: 12098425
Well, no.  If you want a sphere, and you use OO programming to wrapper things, you can let GLUT image you a sphere, and let POVRAY raytrace.  But at some point, primitives don't get the job done, and you need detailed polygonal (or surfaces temp images as triangles) models.

If by 'data visualization' you mean 'home planning' or 'building/office planning', since 'fun' was only one part of your answer and 'profit' was the other, research the field heavily.  There are a growing number of 'simple CAD' programs for say homeowners to place objects around a room and render in 3D.  There are also custom solutions that certain home furnishing stores now use that do the same basic thing.  Know your market, know your competition... There's a lot out there. ;)

When all is done, I'd generally push you to use an existing engine framework if possible, especially if there are a number out there that meet your general needs, esp. wrt POVRAY export support (or built-in raytracer, etc.).


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question