关于float 到const float不能转化的问题
BOOL CKDtreeDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
root = new SoSeparator;
root->ref();
SoMaterial *myMaterial;
root->addChild(myMaterial = new SoMaterial);
myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0);
SoSphere* sphere=new SoSphere;
sphere->radius = 0.1f;
root->addChild(sphere);
int PointNum=100;
float ptss[100][SD];
SoCoordinate3 *pts =new SoCoordinate3;
for(int i=0;i<PointNum;i++)
{
generate_random_point(pTarget,SD);
ptss[i][0]=(float)pTarget[0];
ptss[i][1]=(float)pTarget[1];
ptss[i][2]=(float)pTarget[2];
}
pts->point.setValue(0,1,ptss);
root->addChild(pts);
return TRUE;
}
上述代码中产生的错误是红色部分:
1>c:\documents and settings\scan\desktop\sgg\kdtree\kdtree\kdtreedoc.cpp(133) : error C2664: 'void SoMFVec3f::setValue(const float,const float,const float)' : cannot convert parameter 3 from 'float [100][3]' to 'const float'
SoMFVec3f::setValue是OpenInventor中的函数,请大家帮忙解决下啊?