向高手求救getModelToEyeTransform函数
<p>AsdkCoordSamp::viewportDraw(AcGiViewportDraw* pV)<br/>{<br/> pV->subEntityTraits().setFillType(kAcGiFillAlways);</p><p> const int count = 3;<br/> AcGePoint3d verts;<br/> verts = AcGePoint3d(0.0, 0.0, 0.0);<br/> verts = AcGePoint3d(1.0, 0.0, 0.0);<br/> verts = AcGePoint3d(1.0, 1.0, 0.0);</p><p> // Draw model space line segment.<br/> //<br/> pV->subEntityTraits().setColor(kBlue);<br/> pV->geometry().polygon(count, verts);<br/> <br/> // Compute its representation in eye space.<br/> //<br/> AcGeMatrix3d mat;<br/> pV->viewport().getModelToEyeTransform(mat); </p><p> for (int i = 0; i < count; i++) {<br/> verts.x += 0.01;<br/> verts.y += 0.01;<br/> verts.z += 0.01;<br/> verts.transformBy(mat);<br/> }</p><p> // Display the eye coordinate equivalent of the <br/> // model space polygon.<br/> //<br/> pV->subEntityTraits().setColor(kGreen);<br/> pV->geometry().polygonEye(count, verts);</p><p> // Convert from eye to display coordinates.<br/> // <br/> for (int i = 0; i < count; i++) {<br/> verts.x += 0.01;<br/> verts.y += 0.01;<br/> verts.z += 0.01;<br/> //verts.transformBy(mat);<br/> }</p><p> // Draw the display space equivalent of the<br/> // model space polygon.<br/> //<br/> pV->subEntityTraits().setColor(kRed);<br/> pV->geometry().polygonDc(count, verts);<br/>}</p><p>在这个函数中</p><p>pV->viewport().getModelToEyeTransform(mat); </p><p> for (int i = 0; i < count; i++) {<br/> verts.x += 0.01;<br/> verts.y += 0.01;<br/> verts.z += 0.01;<br/> verts.transformBy(mat);<br/> }</p><p>有getModelToEyeTransform(mat);和verts.transformBy(mat) 起的什么作用啊? 有人给详细解释一下吗? 如何控制视图的?<br/></p>
页:
[1]