Jump to content
  • Advertisement
Sign in to follow this  
drtofu

Simple non-event driven rendering question

This topic is 2521 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

[color=#000000][font=verdana, arial, helvetica, sans-serif]I am trying to write a simple program that would render a large number of 3D models (simple triangular meshes, no fancy shading or lighting), and then run some computer vision processing with each of the rendered images.[/font]

[color=#000000][font=verdana, arial, helvetica, sans-serif]I presumed it would be simple to create a function that reads in an array of triangles and a camera matrix and returns an image; however, I have been unsuccessful thus far.[/font]

[color=#000000][font=verdana, arial, helvetica, sans-serif]People have recommended GLUT to me, but I do not need many of the interactive UI features that complicate GLUT (I don't even need the image to show up on the screen). The event-driven nature of GLUT is absolutely unnecessary for me and overly complicates what I'm trying to do. All I would like is to be able to have a function my program can call, which takes in a 3D model and camera matrix, and returns an image.[/font]

[color=#000000][font=verdana, arial, helvetica, sans-serif]Does anyone have any recommendations, or could point me towards a code sample or tutorial that would show how to do something like this?[/font]

[color=#000000][font=verdana, arial, helvetica, sans-serif]Thanks![/font]

Share this post


Link to post
Share on other sites
Advertisement
Hidden
You can render your models, and get a reference to the actual screen (back?) buffer. I have never done this so I can't say anything beyond that, but it's a pointer on what to do.

Share this post


Link to post

People have recommended GLUT to me, but I do not need many of the interactive UI features that complicate GLUT (I don't even need the image to show up on the screen).

What you want is typically referred to as 'offscreen rendering'. Unfortunately, OpenGL is largely geared towards rendering images to the screen, and while there is some support for offscreen rendering, I don't know of any portable way to obtain an offscreen rendering context - you are probably going to have to get down-and-dirty with your platform's windowing API.

Share this post


Link to post
Share on other sites

What you want is typically referred to as 'offscreen rendering'. Unfortunately, OpenGL is largely geared towards rendering images to the screen, and while there is some support for offscreen rendering, I don't know of any portable way to obtain an offscreen rendering context - you are probably going to have to get down-and-dirty with your platform's windowing API.

Mesa has a platform independent offscreen rendering layer. It's very easy to use; allocate the rendering context, pass it a user-allocated memory buffer to render to and the buffer contains the image when the rendering is complete.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!