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


C++ Mol::Draw方法代码示例

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


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

示例1: prepareDepthTextureForCurrentViewpoint

// FOR HALOS
void prepareDepthTextureForCurrentViewpoint(){
  
  // Draw depth texture from current viewpoint
  
  haloCanvas.SetSameRes( mainCanvas );
  haloCanvas.SetAsOutput();
  
  if (use_accurate_halo)
    shadowSettingsAcc.BindShaders();
  else 
    shadowSettings.BindShaders();
    
    
  glClear( GL_DEPTH_BUFFER_BIT ) ; 
    
  mol.Draw();

  mainCanvas.SetAsOutput();  
  
  glActiveTextureARB(GL_TEXTURE1_ARB); 
  haloCanvas.SetAsTexture();
  glEnable(GL_TEXTURE_2D); 
  
}
开发者ID:zulman,项目名称:qutemol,代码行数:25,代码来源:ShadowMap.cpp

示例2: drawFrame


//.........这里部分代码省略.........
  
  
  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;
      }
    }

    setProjection( mainCanvas.GetVideoSize() );
    track.GetView();
    track.Apply(false); // Set to true to see the trackball itself.
    setProjection( mainCanvas.GetSoftRes() );
    
    if (cgSettings.P_use_shadowmap()) {
      shadowmap.computeAsTexture( getGlLightPos() , cgSettings.do_use_doubleshadow(), shadowmapCanvas);
      //shadowmap.computeAsTexture( Point3f(0,1,0) );
    }

    cgSettings.BindShaders();

    glEnable(GL_TEXTURE_2D);
    //glBindTexture(GL_TEXTURE_2D, molTexture);

    glActiveTextureARB(GL_TEXTURE1_ARB); 
    shadowmapCanvas.SetAsTexture();

    mol.Draw();
    //  shadowmap.m.DrawShadowmap(false);
  
    glDisable(GL_VERTEX_PROGRAM_ARB);
    glDisable(GL_FRAGMENT_PROGRAM_ARB);
    glDisable(GL_BLEND);
    
    if (cgSettings.UseHalo()>0) mol.DrawHalos();
  }

}
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:101,代码来源:Common.cpp


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