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


C++ Matrix3f::GetColumn方法代码示例

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


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

示例1: SetAxes

void ExtendedWmlCamera::SetAxes (const Matrix3f& rkAxes)
{
    m_kLeft = rkAxes.GetColumn(0);
    m_kUp = rkAxes.GetColumn(1);
    m_kDirection = rkAxes.GetColumn(2);
    OnFrameChange();
}
开发者ID:rms80,项目名称:libgeometry,代码行数:7,代码来源:ExtendedWmlCamera.cpp

示例2: AffineTransform

//----------------------------------------------------------------------------
void AffineTransform (int warmups, Ellipsoid3f& ellipsoid0,
                      Ellipsoid3f& ellipsoid1)
{
	float random = 0.0f;
	for (int i = 0; i < warmups; ++i)
	{
		random = Mathf::SymmetricRandom();
	}

	Matrix3f A;
	Vector3f B;
	for (int row = 0; row < 3; ++row)
	{
		for (int col = 0; col < 3; ++col)
		{
			A[row][col] = Mathf::SymmetricRandom();
		}
		B[row] = Mathf::SymmetricRandom();
	}
	if (A.Determinant() < 0.0f)
	{
		A[0][0] = -A[0][0];
		A[0][1] = -A[0][1];
		A[0][2] = -A[0][2];
	}

	Matrix3f invA = A.Inverse();
	Vector3f K = invA*(ellipsoid0.Center - B);
	Matrix3f D(
	    1.0f/(ellipsoid0.Extent[0]*ellipsoid0.Extent[0]),
	    1.0f/(ellipsoid0.Extent[1]*ellipsoid0.Extent[1]),
	    1.0f/(ellipsoid0.Extent[2]*ellipsoid0.Extent[2]));
	Matrix3f N = A.TransposeTimes(D)*A;
	Matrix3f R;
	N.EigenDecomposition(R, D);

	ellipsoid0.Center = K;
	ellipsoid0.Axis[0] = R.GetColumn(0);
	ellipsoid0.Axis[1] = R.GetColumn(1);
	ellipsoid0.Axis[2] = R.GetColumn(2);
	ellipsoid0.Extent[0] = Mathf::InvSqrt(D[0][0]);
	ellipsoid0.Extent[1] = Mathf::InvSqrt(D[1][1]);
	ellipsoid0.Extent[2] = Mathf::InvSqrt(D[2][2]);

	K = invA*(ellipsoid1.Center - B);
	D = Matrix3f(
	        1.0f/(ellipsoid1.Extent[0]*ellipsoid1.Extent[0]),
	        1.0f/(ellipsoid1.Extent[1]*ellipsoid1.Extent[1]),
	        1.0f/(ellipsoid1.Extent[1]*ellipsoid1.Extent[1]));
	N = A.TransposeTimes(D)*A;
	N.EigenDecomposition(R, D);

	ellipsoid1.Center = K;
	ellipsoid1.Axis[0] = R.GetColumn(0);
	ellipsoid1.Axis[1] = R.GetColumn(1);
	ellipsoid1.Axis[2] = R.GetColumn(2);
	ellipsoid1.Extent[0] = Mathf::InvSqrt(D[0][0]);
	ellipsoid1.Extent[1] = Mathf::InvSqrt(D[1][1]);
	ellipsoid1.Extent[2] = Mathf::InvSqrt(D[2][2]);
}
开发者ID:bhlzlx,项目名称:WildMagic,代码行数:61,代码来源:IntersectionEllipsesEllipsoids.cpp

示例3: UpdateWorldData

//----------------------------------------------------------------------------
void LightNode::UpdateWorldData (float fAppTime)
{
    Node::UpdateWorldData(fAppTime);

    if ( m_spkLight )
    {
        Matrix3f kLWorldRotate = m_kWorldRotate*m_kLRotate;
        Vector3f kLWorldTranslate = m_kWorldTranslate +
            m_fWorldScale*(m_kWorldRotate*m_kLTranslate);

        switch ( m_spkLight->GetType() )
        {
        case Light::LT_DIRECTIONAL:
        {
            DirectionalLight* pkDLight =
                WmlStaticCast(DirectionalLight,m_spkLight);
            pkDLight->Direction() = kLWorldRotate.GetColumn(2);
            break;
        }
        case Light::LT_POINT:
        {
            PointLight* pkPLight = WmlStaticCast(PointLight,m_spkLight);
            pkPLight->Location() = kLWorldTranslate;
            break;
        }
        case Light::LT_SPOT:
        {
            SpotLight* pkSLight = WmlStaticCast(SpotLight,m_spkLight);
            pkSLight->Location() = kLWorldTranslate;
            pkSLight->Direction() = kLWorldRotate.GetColumn(2);
            break;
        }
        default:  // Light::LT_AMBIENT, Light::LT_QUANTITY
            break;
        }
    }
}
开发者ID:Steven0818,项目名称:Deform,代码行数:38,代码来源:WmlLightNode.cpp


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