Results 1 to 2 of 2

Thread: 3D Models from Image Slices

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    19

    3D Models from Image Slices

    I have a greyscale bitmap that has the values 0 to 20 at each pixel position.
    These refer to one of 21 bitmaps (of same proportions) that contain the 'sharp' pixel to use at that position.
    So, for each level I have a bitmap image of just the sharp pixels, the rest being black.

    I can see that I have to render each image bitmap on a quad, from back to front with depth-testing enabled, at a certain distance corresponding to it's depthmap value (or 'slice number').

    What is the best way to do this ?

    I will have to make the black transparent, can I copy the depthmap to z-buffer ?

    David Sykes

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: 3D Models from Image Slices

    If the final combined image is a flat 2D composite of the 21 images here's one solution:
    - glDrawPixels of the index image into the stencil buffer.
    - for each image
    + set stencil reference value to image id (0 to 20), set stencil test to GL_EQUAL, set stencil ops to GL_KEEP.
    + draw image (e.g. download all images as textures before and render textured quad, or draw pixels)

    That is for each image only the pixels corresponding to their id in the index image are drawn.

Similar Threads

  1. Can I cut a 2D texture into slices?
    By suttewal in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-21-2010, 02:13 PM
  2. Replies: 4
    Last Post: 08-30-2006, 09:30 PM
  3. view aligned slices
    By trout in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-21-2004, 06:49 AM
  4. 3D Models from Image Slices
    By Microfunguy in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 07-19-2003, 06:52 AM
  5. 2D slices
    By Rajveer in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-14-2002, 01:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean