本文整理汇总了C++中SubMesh::set_data方法的典型用法代码示例。如果您正苦于以下问题:C++ SubMesh::set_data方法的具体用法?C++ SubMesh::set_data怎么用?C++ SubMesh::set_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubMesh
的用法示例。
在下文中一共展示了SubMesh::set_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void initialize(int vehicle_id, float * params)
{
di = new DisplayInterface();
{
for (unsigned int z=0;z<miurabody0_meshes.size();z++)
{
Mesh m = miurabody0_meshes[z];
SubMeshData * smd = new SubMeshData;
smd->t1 = normalmap[0];
smd->u1 = GL_TEXTURE1;
smd->t2 = texture[0];
smd->u2 = GL_TEXTURE2;
smd->Kd[0] = params[0];
smd->Kd[1] = params[1];
smd->Kd[2] = params[2];
smd->Kd[3] = params[3];
smd->Ka[0] = params[4];
smd->Ka[1] = params[5];
smd->Ka[2] = params[6];
smd->Ka[3] = params[7];
smd->Ks[0] = params[8];
smd->Ks[1] = params[9];
smd->Ks[2] = params[10];
smd->Ks[3] = params[11];
smd->shininess = params[12];
smd->cast_shadows[1] = 1;
glGenBuffers(3, smd->vboid);
makeModelVBO_Arrays(smd->vboid,
m.p_vertices,
m.p_normals,
m.p_textures,
m.p_faces,
m.faces_size,
GL_STATIC_DRAW);
smd->faces_size = m.faces_size;
smd->samplers[0] = reflectionmap[0];
vboids.push_back(smd->vboid[0]);
vboids.push_back(smd->vboid[1]);
vboids.push_back(smd->vboid[2]);
SubMesh * sm = new SubMesh;
sm->callback = d_miura0;
sm->set_data(smd);
di->add_submesh(sm);
}
}
/////////////////////////////////////////////////////
{
for (unsigned int i=0;i<miurabody1_meshes.size();i++)
{
Mesh m = miurabody1_meshes[i];
SubMeshData * smd = new SubMeshData;
glGenBuffers(3, smd->vboid);
makeModelVBO_Arrays(smd->vboid,
m.p_vertices,
m.p_normals,
m.p_textures,
m.p_faces,
m.faces_size,
GL_STATIC_DRAW);
smd->faces_size = m.faces_size;
vboids.push_back(smd->vboid[0]);
vboids.push_back(smd->vboid[1]);
vboids.push_back(smd->vboid[2]);
smd->Kd[0] = 0.01f;
smd->Kd[1] = 0.01f;
smd->Kd[2] = 0.01f;
smd->Kd[3] = 1.0f;
smd->Ka[0] = 0.02f;
smd->Ka[1] = 0.02f;
smd->Ka[2] = 0.02f;
smd->Ka[3] = 1.0f;
smd->Ks[0] = 0.4f;
smd->Ks[1] = 0.4f;
smd->Ks[2] = 0.4f;
smd->Ks[3] = 1.0f;
smd->shininess = 10.0f;
smd->cast_shadows[1] = 1;
SubMesh * sm = new SubMesh;
sm->callback = d_miura2;
sm->set_data(smd);
di->add_submesh(sm);
}
}
/////////////////////////////////////////////////
{
for (unsigned int i=0;i<miurachrome0_meshes.size();i++)
{
Mesh m = miurachrome0_meshes[i];
//.........这里部分代码省略.........