Re: [PyOpenGL-Users] Drawing a bitmap at "native" resolution
Brought to you by:
mcfletch
|
From: Ian M. <geo...@gm...> - 2011-05-03 05:31:26
|
On Mon, May 2, 2011 at 3:18 PM, Christopher Barker <Chr...@no...>wrote: > Hi folks, > > Anyone know of a performant way to draw a bitmap at its "native" > resolution -- i.e. one pixel in the bitmap is one pixel on screen, > regardless of zoom level, etc. I think I've heard this referred to as > "billboard" view, but that may be a term specific to one visualization > lib (VTK, maybe)? > > Anyway, the task at hand is using bitmaps fonts as textures to do simple > text labels, lot of them, in a scientific visualization app. > > For each data point ( up to 100s of thousands ) we need a little text > label. But we want the text to not change size as the user zooms in or out. > There's not a way to get around projecting the labels' locations on screen. You'd have to use gluProject(...). If you want to be fancy, you can use a vertex shader to project to get each coordinate. >From there, set up a 2D view. Then, draw each label at the screen coordinate of its projected location, using textured quads the same size as your textures. Ian |