View Full Version : Texture 3D to Image..
08-09-2007, 03:13 AM
Im not very expert OpenGl developper but my problem isn't not trivial...and not for beginners too..
I'm developping a Multi-Planar Reconstruction for medical application and I'm a texture 3D that I cut with some quads for display different sections (Images 2D) translating plans..
Now, I would get back Images 2D diaplayed on the quads, in a buffer...but I don't have Ideas what... :confused:
Do you have???
thank you very much
08-09-2007, 04:45 AM
So basically you want to extract a 2D image layer from a 3D texture, is this correct? In such case, you can just draw a quad, textured with the appropiate texture layer and get the array of pixels using the ReadPixels function. I am not sure how this is an advanced question though...
08-09-2007, 05:55 AM
I you don't need the results back on the CPU, simply use glTexSubImage (http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copytexsubimage2d.html) to copy a portion of screen to texture (faster).
EDIT: more precise.
08-09-2007, 09:18 AM
In fact i draw a quad but in my viewer ther are a lot of object and i would recover back onli the 2D cut and not all the screen
08-09-2007, 01:22 PM
Yes of course.
Please read the link I posted.
08-10-2007, 03:41 AM
In fact I would like get back the interpolted images in the seme qualities and size of original images source of texture
08-10-2007, 06:21 AM
What prevents you from rendering your 2D quad (with appropriate scale to match texture size) on screen, then copy to tex, then clear (no swap) then do the real classic rendering ?
I am not sure if you are advanced enough, but another possibility is to render to a FBO (http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt) .
Search the web for other tutorials on opengl FBO.
08-13-2007, 02:13 AM
thanks I 'll try with the FBO....
but with this object, can I get back the interpolated images? the parameter zoffset is int....
thank you very much..
08-14-2007, 07:33 AM
I'm ssorry, another question..
can i with the FBO recover back all t possible cut image (In every direction) of texture 3D???
08-14-2007, 12:16 PM
I don't really understand... Just render the part of the 3d texture on a fullscreen quad, either using FBO or without it (doesn't matter anyway). Then read or copy it. Like this (without vbo):
bind 3d texture
render a quad
repeat as much you want
render the scene
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.