Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 2004-09-18
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 17

Accepted Solution

davebytes earned 1500 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

670 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