void CVpapp::notify(vsChannel::Event, const vsChannel *channel, vrDrawContext *context)
{
context->pushElements(true);
// need to disable the depth buffer since it's enabled by default
vrDepthTest::Element depthTestElement;
depthTestElement.m_enable = false;
context->setElement(vrDepthTest::Element::Id, &depthTestElement);
// set up an orthographic projection. In this case we'll just map the
// channel viewport to 0 to 1 both horizontally and vertically.
vrTransform::ElementProjection projectionElement;
projectionElement.makeOrthographic(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);
context->setElement(vrTransform::ElementProjection::Id,
&projectionElement);
vuString strText;
vpObserver *pObserver = *vpObserver::begin();
double x,y,z,h,p,r;
pObserver->getTranslate(&x,&y,&z);
pObserver->getRotate(&h,&p,&r);
strText.sprintf("x:%.2f y:%.2f z:%.2f h:%.2f p:%.2f r:%.2f",x,y,z,h,p,r);
vuVec4<float> color(1.0f, 0.0f, 0.0f, 1.0f);
m_font->displayStringAt(context, strText.c_str(), color, 0.01, 0.01);
context->popElements();
} |