本文整理汇总了C++中matrix::Adjacent方法的典型用法代码示例。如果您正苦于以下问题:C++ matrix::Adjacent方法的具体用法?C++ matrix::Adjacent怎么用?C++ matrix::Adjacent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matrix
的用法示例。
在下文中一共展示了matrix::Adjacent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
TGAImage image(width, height, TGAImage::RGB);
TGAImage image_shdr(width, height, TGAImage::RGB);
std::vector<string> names;
std::vector<string> diffs;
std::vector<string> nm;
std::vector<string> gls;
std::vector<coeffs> coeff;
names.push_back("african_head.obj");
//names.push_back("floor.obj");
names.push_back("african_head_eye_inner.obj");
//names.push_back("african_head_eye_outer.obj");
//names.push_back("diablo3_pose.obj");
diffs.push_back("african_head_diffuse.tga");
//diffs.push_back("floor_diffuse.tga");
diffs.push_back("african_head_eye_inner_diffuse.tga");
//diffs.push_back("african_head_eye_outer_diffuse.tga");
//diffs.push_back("diablo3_pose_diffuse.tga");
nm.push_back("african_head_nm.tga");
//nm.push_back("floor_nm_tangent.tga");
nm.push_back("african_head_eye_inner_nm.tga");
//nm.push_back("african_head_eye_outer_nm.tga");
//nm.push_back("diablo3_pose_nm.tga");
gls.push_back("african_head_spec.tga");
//gls.push_back("floor_nm_tangent.tga");
gls.push_back("african_head_eye_inner_spec.tga");
//gls.push_back("african_head_eye_outer_spec.tga");
//gls.push_back("diablo3_pose_spec.tga");
coeff.push_back(coeffs(20,1.2f,0.6f));
//coeff.push_back(coeffs(10,1.f,0.6f));
coeff.push_back(coeffs(20,1.2f,0.6f));
//coeff.push_back(coeffs(10,1.f,4.6f));
//coeff.push_back(coeffs(20,1.2f,0.6f));
char name_file[40];
char name_file_diff[40];
char name_file_norm[40];
char name_file_spec[40];
ViewPortMtx=viewport(width/8,height/8 , width*3/4, height*3/4, zeight);
//width/8, height/8, width*3/4, height*3/4
//PerspMtx=perspective((eye-center).norm());
PerspMtx=perspective((eye-center).norm());
view = lookat(eye, center,up);
shdw=ViewPortMtx*lookat(light_vec,center,up);
shdw_adj=shdw.Adjacent();
vect<4,float> gl_light_shdw;
gl_light_shdw[0]=light_vec[0];
gl_light_shdw[1]=light_vec[1];
gl_light_shdw[2]=light_vec[2];
gl_light_shdw=shdw*gl_light_shdw;
printf("gl_light_shdw %f %f %f\n",gl_light_shdw[0],gl_light_shdw[1],gl_light_shdw[2]);
light_vec_shdw=vect<3,float>(gl_light_shdw[0],gl_light_shdw[1],gl_light_shdw[2]);
light_vec_shdw=light_vec_shdw.normalize();
fin_mtrx=ViewPortMtx*PerspMtx*view;
fin_mtrx_adj=(ViewPortMtx*view).invert_transpose();
uniform_Mshadow=shdw*fin_mtrx.invert();
//light_dir = proj<3>((Projection*ModelView*embed<4>(light_dir, 0.f))).normalize();
vect<4,float> gl_light;
gl_light[0]=light_vec[0];
gl_light[1]=light_vec[1];
gl_light[2]=light_vec[2];
gl_light=ViewPortMtx*PerspMtx*view*gl_light;
light_vec=vect<3,float>(gl_light[0],gl_light[1],gl_light[2]);
light_vec=light_vec.normalize();
for (int i =0; i<names.size(); i++) {
//.........这里部分代码省略.........