Clipping 2D text - working around glRasterPos

  • Follow


Hi,

I've been searching the web (in vain) for an example of how to clip text 
to a region such that only the visible portion of the text is displayed.  
As most everyone who has worked with glCallLists and glRasterPos to 
display text probably already knows, the text string is not rendered in 
certain circumstances (i.e. glRasterPos2i(-1, 50) when the viewport is 
(0,0) - (100,100))

Is there a workaround for this?  There must be a way to do this fairly 
painlessly.... I hope.

Any help would be most appreciated!

Thanks,
Brian


0
Reply Brian 3/23/2005 6:36:08 AM

Brian wrote:
> Hi,
> 
> I've been searching the web (in vain) for an example of how to clip text 
> to a region such that only the visible portion of the text is displayed.  
> As most everyone who has worked with glCallLists and glRasterPos to 
> display text probably already knows, the text string is not rendered in 
> certain circumstances (i.e. glRasterPos2i(-1, 50) when the viewport is 
> (0,0) - (100,100))
> 

Instead of:
glRasterPos2i(x,y);

Use:

glRasterPos2i(0,0);
glBitmap(0,0,0,0,x,y,NULL);


-- 
<\___/>
/ O O \
\_____/  FTB.    For email, remove my socks.

Governments, like diapers, should be changed often,
and for the same reason.
0
Reply fungus 3/23/2005 8:15:28 AM


THANKS!  That works great!

> Brian wrote:
>> Hi,
>> 
>> I've been searching the web (in vain) for an example of how to clip text 
>> to a region such that only the visible portion of the text is displayed.  
>> As most everyone who has worked with glCallLists and glRasterPos to 
>> display text probably already knows, the text string is not rendered in 
>> certain circumstances (i.e. glRasterPos2i(-1, 50) when the viewport is 
>> (0,0) - (100,100))
>> 

> Instead of:
> glRasterPos2i(x,y);

> Use:

> glRasterPos2i(0,0);
> glBitmap(0,0,0,0,x,y,NULL);


> -- 
> <\___/>
> / O O \
> \_____/  FTB.    For email, remove my socks.

> Governments, like diapers, should be changed often,
> and for the same reason.

-- 
Brian


0
Reply Brian 3/23/2005 4:57:13 PM

2 Replies
330 Views

(page loaded in 0.059 seconds)

Similiar Articles:








7/23/2012 8:10:05 PM


Reply: