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


C++ Matrix3::RotateY方法代码示例

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


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

示例1: IGetViewTM

Matrix3 plStaticEnvLayer::IGetViewTM( int i )
{
    Matrix3 m;
    m.IdentityMatrix();
    switch( i ) 
    {
        case kTopFace:
            m.RotateX( -M_PI );   
            break;
        case kBottomFace:
            break;
        case kLeftFace:
            m.RotateX( -.5f * M_PI ); 
            m.RotateY( -.5f * M_PI );
            break;
        case kRightFace:
            m.RotateX( -.5f * M_PI ); 
            m.RotateY( +.5f * M_PI );
            break;
        case kFrontFace:
            m.RotateX( -.5f * M_PI ); 
            m.RotateY( M_PI );
            break;
        case kBackFace:
            m.RotateX( -.5f * M_PI ); 
            break;
    }
    return m;
}
开发者ID:Asteral,项目名称:Plasma,代码行数:29,代码来源:plStaticEnvLayer.cpp

示例2: switch

StretchDeformer::StretchDeformer(TimeValue t, ModContext &mc,
                                 float stretch, float amplify, int naxis, 
                                 float from, float to, int doRegion,
                                 Matrix3& modmat, Matrix3& modinv) 
{
    Matrix3 mat;
    Interval valid;     
//    if (from==to) doRegion = FALSE;
    this->doRegion = doRegion;
    this->from = from;
    this->to   = to;
    time   = t; 

    tm = modmat;
    invtm = modinv;
    mat.IdentityMatrix();
        
    switch ( naxis ) {
    case 0: mat.RotateY( -HALFPI );      break; //X
    case 1: mat.RotateX( HALFPI );  break; //Y
    case 2: break;  //Z
    }
    SetAxis( mat );     
    assert (mc.box);
    bbox = *mc.box;
    CalcBulge(naxis, stretch, amplify);
} 
开发者ID:2asoft,项目名称:xray,代码行数:27,代码来源:stretch.cpp

示例3:

BendDeformer::BendDeformer(
		TimeValue t, ModContext &mc,
		float angle, float dir, int naxis, 
		float from, float to, int doRegion,
		Matrix3& modmat, Matrix3& modinv) 
	{	
	this->doRegion = doRegion;
	this->from = from;
	this->to   = to;
	Matrix3 mat;
	Interval valid;	
	time   = t;	

	tm = modmat;
	invtm = modinv;
	mat.IdentityMatrix();
	
	switch (naxis) {
		case 0: mat.RotateY( -HALFPI );	 break; //X
		case 1: mat.RotateX( HALFPI );  break; //Y
		case 2: break;  //Z
		}
	mat.RotateZ(DegToRad(dir));	
	SetAxis(mat);	
	assert (mc.box);
	bbox = *mc.box;
	CalcR(naxis,DegToRad(angle));
	
	// Turn this off for a sec.
	this->doRegion = FALSE;
		
	float len  = to-from;
	float rat1, rat2;
	if (len==0.0f) {
		rat1 = rat2 = 1.0f;
	} else {
		rat1 = to/len;
		rat2 = from/len;
		}
	Point3 pt;
	tmAbove.IdentityMatrix();
	tmAbove.Translate(Point3(0.0f,0.0f,-to));
	tmAbove.RotateY(DegToRad(angle * rat1));
	tmAbove.Translate(Point3(0.0f,0.0f,to));
	pt = Point3(0.0f,0.0f,to);
	tmAbove.Translate((Map(0,pt*invtm)*tm)-pt);

	tmBelow.IdentityMatrix();
	tmBelow.Translate(Point3(0.0f,0.0f,-from));
	tmBelow.RotateY(DegToRad(angle * rat2));	
	tmBelow.Translate(Point3(0.0f,0.0f,from));
	pt = Point3(0.0f,0.0f,from);
	tmBelow.Translate((Map(0,pt*invtm)*tm)-pt);	
	
	this->doRegion = doRegion;

	} 
开发者ID:2asoft,项目名称:xray,代码行数:57,代码来源:bend.cpp

示例4: float

TwistDeformer::TwistDeformer(
      TimeValue t, ModContext &mc,
      float angle, int naxis, float bias,
      float from, float to, int doRegion,
      Matrix3& modmat, Matrix3& modinv) 
   {  
   this->doRegion = doRegion;
   this->from = from;
   this->to   = to;
   if (bias!=0.0f) {
      this->bias = 1.0f-(bias+100.0f)/200.0f;
      if (this->bias < 0.00001f) this->bias = 0.00001f;
      if (this->bias > 0.99999f) this->bias = 0.99999f;
      this->bias = float(log(this->bias)/log(0.5));
      doBias = TRUE;
   } else {
      this->bias = 1.0f;
      doBias = FALSE;
      }
   
   Matrix3 mat;
   Interval valid;   
   time   = t; 

   tm = modmat;
   invtm = modinv;
   mat.IdentityMatrix();
   
   switch ( naxis ) {
      case 0: mat.RotateY( -HALFPI );   break; //X
      case 1: mat.RotateX( HALFPI );  break; //Y
      case 2: break;  //Z
      }
   SetAxis( mat );   
   assert (mc.box);
   bbox = *mc.box;
   CalcHeight(naxis,DegToRad(angle));
   }
开发者ID:artemeliy,项目名称:inf4715,代码行数:38,代码来源:twist.cpp

示例5: Inverse

SkewDeformer::SkewDeformer(
		ModContext &mc,
		float amount, float dir, int naxis, 
		float from, float to, int doRegion,
		Matrix3& modmat, Matrix3& modinv) 
	{	
	this->doRegion = doRegion;
	this->from = from;
	this->to   = to;
	Matrix3 mat;
	
	mat.IdentityMatrix();	
	switch (naxis) {
		case 0: mat.RotateY( -HALFPI );	 break; //X
		case 1: mat.RotateX( HALFPI );  break; //Y
		case 2: break;  //Z
		}
	mat.RotateZ(DegToRad(dir));		
	tm    = modmat * mat;
	invtm = Inverse(mat) * modinv;
	
	assert (mc.box);
	bbox = *mc.box;
	
	float len = 0.0f;
	if (!doRegion) {
		switch (naxis) {
			case 0:  len = bbox.pmax.x - bbox.pmin.x; break;
			case 1:	 len = bbox.pmax.y - bbox.pmin.y; break;
			case 2:  len = bbox.pmax.z - bbox.pmin.z; break;
			}
	} else {
		len = to-from;
		}		
	if (len==0.0f) len = 0.000001f;
	amountOverLength = amount/len;
	} 
开发者ID:2asoft,项目名称:xray,代码行数:37,代码来源:skew.cpp


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