本文整理汇总了C++中Model3D::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Model3D::Clear方法的具体用法?C++ Model3D::Clear怎么用?C++ Model3D::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model3D
的用法示例。
在下文中一共展示了Model3D::Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadModel_Studio
bool LoadModel_Studio(FileSpecifier& Spec, Model3D& Model)
{
ModelPtr = &Model;
Model.Clear();
if (DBOut)
{
// Name buffer
const int BufferSize = 256;
char Buffer[BufferSize];
Spec.GetName(Buffer);
fprintf(DBOut,"Loading 3D Studio Max model file %s\n",Buffer);
}
OpenedFile OFile;
if (!Spec.Open(OFile))
{
if (DBOut) fprintf(DBOut,"ERROR opening the file\n");
return false;
}
ChunkHeaderData ChunkHeader;
if (!ReadChunkHeader(OFile,ChunkHeader)) return false;
if (ChunkHeader.ID != MASTER)
{
if (DBOut) fprintf(DBOut,"ERROR: not a 3DS Max model file\n");
return false;
}
if (!ReadContainer(OFile,ChunkHeader,ReadMaster)) return false;
return (!Model.Positions.empty() && !Model.VertIndices.empty());
}
示例2: LoadModel_Studio
bool LoadModel_Studio(FileSpecifier& Spec, Model3D& Model)
{
ModelPtr = &Model;
Model.Clear();
Path = Spec.GetPath();
logNote1("Loading 3D Studio Max model file %s",Path);
OpenedFile OFile;
if (!Spec.Open(OFile))
{
logError1("ERROR opening %s",Path);
return false;
}
ChunkHeaderData ChunkHeader;
if (!ReadChunkHeader(OFile,ChunkHeader)) return false;
if (ChunkHeader.ID != MASTER)
{
logError1("ERROR: not a 3DS Max model file: %s",Path);
return false;
}
if (!ReadContainer(OFile,ChunkHeader,ReadMaster)) return false;
if (Model.Positions.empty())
{
logError1("ERROR: no vertices found in %s",Path);
return false;
}
if (Model.VertIndices.empty())
{
logError1("ERROR: no faces found in %s",Path);
return false;
}
return true;
}
示例3: LoadModel_QD3D
bool LoadModel_QD3D(FileSpecifier& Spec, Model3D& Model)
{
// Clear out the final model object
Model.Clear();
// Test for QD3D/Quesa's presence and initialize it if not present
if (QD3D_Presence_Checked)
{
if (!QD3D_Present) return false;
}
else
{
QD3D_Presence_Checked = true;
// MacOS QD3D; modify this for Quesa as appropriate
if ((void*)Q3Initialize != (void*)kUnresolvedCFragSymbolAddress)
{
TQ3Status Success = Q3Initialize();
QD3D_Present = (Success == kQ3Success);
}
// Do additional setup;
// if the triangulator could not be created, then act as if
// QD3D/Quesa had not been loaded
if (QD3D_Present)
{
Q3Error_Register(QD3D_Error_Handler,0);
QD3D_Present = CreateTriangulator();
}
if (!QD3D_Present)
Q3Exit();
}
if (DBOut)
{
// Read buffer
const int BufferSize = 256;
char Buffer[BufferSize];
Spec.GetName(Buffer);
fprintf(DBOut,"Loading QuickDraw-3D model file %s\n",Buffer);
}
TQ3Object ModelObject = LoadModel(Spec);
if (!ModelObject) return false;
StartAccumulatingVertices();
if (Q3View_StartRendering(TriangulatorView) == kQ3Failure)
{
if (DBOut) fprintf(DBOut,"ERROR: couldn't start triangulation 'rendering'\n");
Q3Object_Dispose(ModelObject);
return false;
}
do
{
Q3SubdivisionStyle_Submit(&TesselationData, TriangulatorView);
if (Q3Object_Submit(ModelObject, TriangulatorView) == kQ3Failure)
{
if (DBOut) fprintf(DBOut,"ERROR: model could not be 'rendered'\n");
}
}
while (Q3View_EndRendering(TriangulatorView) == kQ3ViewStatusRetraverse);
// Done with the model
Q3Object_Dispose(ModelObject);
GetVerticesIntoModel(Model);
return !Model.Positions.empty();
}