当前位置: 首页>>代码示例>>C++>>正文


C++ TriMesh::UpdateMS方法代码示例

本文整理汇总了C++中TriMesh::UpdateMS方法的典型用法代码示例。如果您正苦于以下问题:C++ TriMesh::UpdateMS方法的具体用法?C++ TriMesh::UpdateMS怎么用?C++ TriMesh::UpdateMS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TriMesh的用法示例。


在下文中一共展示了TriMesh::UpdateMS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Box

//----------------------------------------------------------------------------
TriMesh* StandardMesh::Box (float fXExtent, float fYExtent, float fZExtent)
{
    int iVQuantity = 8;
    int iTQuantity = 12;
    CreateData(iVQuantity,iTQuantity);

    // generate geometry
    m_akVertex[0] = Vector3f(-fXExtent,-fYExtent,-fZExtent);
    m_akVertex[1] = Vector3f(+fXExtent,-fYExtent,-fZExtent);
    m_akVertex[2] = Vector3f(+fXExtent,+fYExtent,-fZExtent);
    m_akVertex[3] = Vector3f(-fXExtent,+fYExtent,-fZExtent);
    m_akVertex[4] = Vector3f(-fXExtent,-fYExtent,+fZExtent);
    m_akVertex[5] = Vector3f(+fXExtent,-fYExtent,+fZExtent);
    m_akVertex[6] = Vector3f(+fXExtent,+fYExtent,+fZExtent);
    m_akVertex[7] = Vector3f(-fXExtent,+fYExtent,+fZExtent);

    if (m_bUVs)
    {
        m_akUV[0] = Vector2f(0.25f,0.75f);
        m_akUV[1] = Vector2f(0.75f,0.75f);
        m_akUV[2] = Vector2f(0.75f,0.25f);
        m_akUV[3] = Vector2f(0.25f,0.25f);
        m_akUV[4] = Vector2f(0.0f,1.0f);
        m_akUV[5] = Vector2f(1.0f,1.0f);
        m_akUV[6] = Vector2f(1.0f,0.0f);
        m_akUV[7] = Vector2f(0.0f,0.0f);
    }

    // generate connectivity (outside view)
    m_aiIndex[ 0] = 0;  m_aiIndex[ 1] = 2;  m_aiIndex[ 2] = 1;
    m_aiIndex[ 3] = 0;  m_aiIndex[ 4] = 3;  m_aiIndex[ 5] = 2;
    m_aiIndex[ 6] = 0;  m_aiIndex[ 7] = 1;  m_aiIndex[ 8] = 5;
    m_aiIndex[ 9] = 0;  m_aiIndex[10] = 5;  m_aiIndex[11] = 4;
    m_aiIndex[12] = 0;  m_aiIndex[13] = 4;  m_aiIndex[14] = 7;
    m_aiIndex[15] = 0;  m_aiIndex[16] = 7;  m_aiIndex[17] = 3;
    m_aiIndex[18] = 6;  m_aiIndex[19] = 4;  m_aiIndex[20] = 5;
    m_aiIndex[21] = 6;  m_aiIndex[22] = 7;  m_aiIndex[23] = 4;
    m_aiIndex[24] = 6;  m_aiIndex[25] = 5;  m_aiIndex[26] = 1;
    m_aiIndex[27] = 6;  m_aiIndex[28] = 1;  m_aiIndex[29] = 2;
    m_aiIndex[30] = 6;  m_aiIndex[31] = 2;  m_aiIndex[32] = 3;
    m_aiIndex[33] = 6;  m_aiIndex[34] = 3;  m_aiIndex[35] = 7;

    if (m_bInside)
    {
        ReverseTriangleOrder(iTQuantity);
    }

    TransformData(iVQuantity);
    TriMesh* pkMesh = WM3_NEW TriMesh(m_spkVertices,m_spkIndices,false);
    if (m_spkNormals)
    {
        pkMesh->Normals = m_spkNormals;
        pkMesh->UpdateMS(true);
    }
    return pkMesh;
}
开发者ID:juhgiyo,项目名称:Soft3DEngine,代码行数:57,代码来源:Wm3StandardMesh.cpp


注:本文中的TriMesh::UpdateMS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。