本文整理汇总了C++中Mol::getDefaultViewRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ Mol::getDefaultViewRotation方法的具体用法?C++ Mol::getDefaultViewRotation怎么用?C++ Mol::getDefaultViewRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mol
的用法示例。
在下文中一共展示了Mol::getDefaultViewRotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawFrame
void drawFrame() {
cgSettings.MakeShaders();
if (mol.DoingAO()) {
// do at least one more step per rendering
mol.PrepareAOstep(1);
// continue until decent
while (!mol.DecentAO()) mol.PrepareAOstep(1);
}
/*if (cgSettings.UseHalo()>0) {
// write depth in HaloTexture
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, haloFrame);
} else {
// write depth in depthbuffer
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
}*/
mainCanvas.SetAsOutput();
if (cgSettings.doingAlphaSnapshot)
glClearColor( cgSettings.P_halo_col, cgSettings.P_halo_col, cgSettings.P_halo_col, 0.0f);
else
glClearColor( cgSettings.P_bg_color_R, cgSettings.P_bg_color_G, cgSettings.P_bg_color_B, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
Point3f lightDir;
if ( cgSettings.P_sem_effect // fixed light dir sem effect
// || mol.sticks // quick Hack: fixed light dir when bonds
)
lightDir= Point3f(0,0,1);
else
lightDir=getDirFromTrackball(lightTrack);
setLightDir( lightDir );
// gluLookAt(0,0,-3, 0,0,0, 0,1,0); original
// gluLookAt(0,0,-3, 0,0,0, 0,1,0); ok for tra
if (mol.hasDefaultView())
gluLookAt(0,0, 40, 0,0,0, 0,1,0);
else
gluLookAt(0,0,-40, 0,0,0, 0,1,0);
if(MovingLightMode)
drawLightDir();
glColor3f(1,1,1);
if (mol.hasDefaultView()) {
float angle, axisX, axisY, axisZ;
mol.getDefaultViewRotation(&angle, &axisX, &axisY, &axisZ);
glRotatef(angle, axisX, axisY, axisZ);
}
if (1) {
//track.center=Point3f(0, 0, 0);
//track.radius= 1;
//setProjection();
if (aniStep>=0) // BH: Doesn't normally seem to be aniStep>=0
{
double extraRot=360.0*aniStep;
// set extra rotation for GIF animation:
switch (hardSettings.GIF_ANIMATION_MODE) {
default:
case 0:
glRotated(-hardSettings.GIF_ROT_SIDEVIEW_ANGLE,1,0,0);
glRotated(extraRot,0,1,0);
break;
case 1:
glRotated(-extraRot,0,0,1);
glRotated(hardSettings.GIF_INSP_ANGLE,0,1,0);
glRotated(extraRot,0,0,1);
break;
case 2:{
double substep[6];
for (int i=0; i<6; i++) {
substep[i]=(aniStep*6-i)*90.0;
if (substep[i]<0) substep[i]=0;
if (substep[i]>90.0) substep[i]=90.0;
}
glRotated(-substep[5], 1,0,0);
glRotated(-substep[4], 0,1,0);
glRotated(-substep[3], 0,1,0);
glRotated(-substep[2], 1,0,0);
glRotated(-substep[1], 0,1,0);
glRotated(-substep[0], 0,1,0);
}break;
//.........这里部分代码省略.........