This project is read-only.

Draw box around UI3DRendered Text

Mar 24, 2011 at 11:46 PM
Edited Mar 27, 2011 at 12:39 AM

Hi,

I want to draw a rectangle around text that is rendered using UI3DRender. The UI3DRenderer text is placed at a certain distance from a marker, based on the marker's woldtransformation. UI2DRender can draw a rectangle, but the X and Y components are relative to the top left hand corner of the screen. I've applied a 3D projection to map the 3D image to the computer's 2D plane, and the rectangles appear at the correct orientation to the text. But the rectangles move with my line of sight. How would I go about placing and keeping the rectangles around the text? I notice that the camera.projection is set using Matrix.CreatePerspectiveFieldOfView(...). I use Vuzix iwear as the camera. Does that mean that when I move my head/the camera, the rectangles move as well?

Also, how can I determine the length and width of the rendered text so the text and box have the same dimensions?

Thanks.