title: 3D Scene graph traversing problem
body: <p>I have implemented a small scene graph to be rendered by OpenGL, all the objects derive from a common <code>Node</code> class and during OpenGL frame rendering I just call the <code>visit</code> method of the root node and it traverses the graph recursively. The first matrix I pass when beginning traversal is the camera matrix.</p>
  
  <p>The <code>visit</code> method looks like this:</p>
  
  <pre><code>void Node::visit(const QMatrix4x4 &amp;mv) {
      QMatrix4x4 m = mv;
      m.rotate(m_rot);
      m.translate(m_pos);
      m.scale(m_scale);
  
      m_effectiveMV = m;
  
      for (int i = 0; i &lt; m_children.size(); i++) {
          m_children[i]-&gt;visit(m_effectiveMV);
      }
  
      draw(); // draws if this node has anything to draw,
              // otherwise just transformation.
  }
  </code></pre>
  
  <p>The problem I experience is, when I set rotation for a child node, the rotation happens relative to the parent node, not around the node itself. Can anyone spot what I'm doing wrong here?</p>