Hello, I am trying to make an attitude indicator and a magnometer visualization and I'm reallly stuck.
I was orignally gonna just build a magnometer by drawing 2d polys and rotating it, but I can't get the 2d stuff to rotate at all. I'm using m_pVideoDriver->setTransform(irr::video::ETS_WORLD, m_pNode->getRelativeTransformation());
m_pNode->setRotation(rot);
m_pVideoDriver->draw2DPolygon(m_position,45.4f,video::SColor(255,220,220,220),18);
but it must be compeltely wrong because I don't know/have a way to associate the polygon with the node.
I dunno if anyone has any ideas on how to make the visualizations.
Attitude indicator & Magnometer help?
A few things...
Travis
- Aaron, is that you?
- When you set the world transform, you almost always want the nodes absolute transformation [the one that converts from object space coordinates to world space coordinates]. You can get that with getAbsoluteTransformation().
- Setting the world transform only applies when rendering 3d objects. When you call draw2DPolygon it sets the driver up for rendering 2d primitives, and it wipes out whatever transforms you may have set.
Travis