ObjectARX, AutoCAD. Среда программирования библиотеки C++


         

Set the extents of the


// ones blue.
//
// Set the extents of the pyramid here because
// AcGiViewportGeometry’s polylineEye() doesn’t
// set extents.
//
for (Adesk::UInt32 i = 0; i < mNumVerts; i++) {
AcGePoint3d pt[2];
pt[0] = mVerts[i];
pt[1] = mVerts[(i + 1) % mNumVerts];
pW->geometry().setExtents(pt);
}
return Adesk::kFalse; // Call viewport draws.
}
// Otherwise, give HIDE, SHADE, RENDER, or proxy graphics
// a pyramid with filled faces.
//
const Adesk::UInt32 faceListSize = 16;
static Adesk::Int32 faceList[faceListSize] = {
3, 0, 1, 2,
3, 0, 2, 3,
3, 0, 3, 1,
3, 1, 2, 3
};
pW->geometry().shell(mNumVerts, mVerts, faceListSize, faceList);
return Adesk::kTrue; // Do not call viewportDraw.
}
void
AsdkViewGeomSamp::viewportDraw(AcGiViewportDraw* pV)
{
// For this viewport, draw a pyramid with yellow
// visible lines and blue hidden lines.
//
// Get this viewport’s net transform. This transform
// includes this entity’s block transforms and this
// viewport’s view transform; it does not include the
// perspective transform if we’re in perspective
// mode; that currently has to be applied separately
// when in perspective mode.
//
AcGeMatrix3d modelToEyeMat;
pV->viewport().getModelToEyeTransform(modelToEyeMat);
// Get the pyramid’s vertices.
//
AcGePoint3d A = mVerts[0];
AcGePoint3d B = mVerts[1];
AcGePoint3d C = mVerts[2];
AcGePoint3d D = mVerts[3];
// Convert them to the viewport’s eye coordinates.
//
A.transformBy(modelToEyeMat);
B.transformBy(modelToEyeMat);
C.transformBy(modelToEyeMat);
D.transformBy(modelToEyeMat);
// Save the eye coordinates.
//
AcGePoint3d AEye = A;
AcGePoint3d BEye = B;
AcGePoint3d CEye = C;
AcGePoint3d DEye = D;
// Perform the perspective transform if necessary.
//
if (pV->viewport().isPerspective()) {
pV->viewport().doPerspective(A);
pV->viewport().doPerspective(B);
pV->viewport().doPerspective(C);
pV->viewport().doPerspective(D);
}
// From that view, figure out which faces are

Содержание  Назад  Вперед





Forekc.ru
Рефераты, дипломы, курсовые, выпускные и квалификационные работы, диссертации, учебники, учебные пособия, лекции, методические пособия и рекомендации, программы и курсы обучения, публикации из профильных изданий