Beispiel #1
0
rmatrix RSBase3D::GetMatrix()
{
	if(LastFrame!=RSFrameCount)
	{
		matm=MatrixMult(MatrixMult(RotateYMatrix(RoleFactor),
			ScaleMatrixXYZ(ScaleFactorX,ScaleFactorY,ScaleFactorZ)),mat);
		if(parent)matm=MatrixMult(matm,parent->GetMatrix());
		LastFrame=RSFrameCount;
	}
	return matm;
}
Beispiel #2
0
int
APITestUtil::MakeTest2RailSweepSurface(NURBSSet &nset)
{
	int rail1 = P1Curve(nset, ScaleMatrix(Point3(70, 70, 70)));
	int rail2 = P1Curve(nset, ScaleMatrix(Point3(90, 90, 90)));
	int cross = P1Curve(nset, ScaleMatrix(Point3(5, 5, 5)) *
							RotateYMatrix(PI/2.0f) *
							TransMatrix(Point3(70, 70, 0)));
	NURBS2RailSweepSurface *s = new NURBS2RailSweepSurface();
	s->SetName(GetString(IDS_2RAIL_SURFACE));
	s->SetNSet(&nset);

	s->SetRailParent(0, rail1);
	s->SetRailParent(1, rail2);
	s->AppendCurve(cross, FALSE);

	return nset.AppendObject(s);
}
Beispiel #3
0
int
APITestUtil::MakeTest1RailSweepSurface(NURBSSet &nset)
{
	int rail = P1Curve(nset, ScaleMatrix(Point3(50, 50, 50)));
	int cross = P1Curve(nset, ScaleMatrix(Point3(5, 5, 5)) *
							RotateYMatrix(PI/2.0f) *
							TransMatrix(Point3(50, 50, 0)));
	NURBS1RailSweepSurface *s = new NURBS1RailSweepSurface();
	s->SetName(GetString(IDS_1RAIL_SURFACE));
	s->SetNSet(&nset);

	s->SetParentRail(rail);
	s->AppendCurve(cross, FALSE);
	s->SetParallel(FALSE);
	s->FlipNormals(TRUE);

	return nset.AppendObject(s);
}
Beispiel #4
0
void RSBase3D::UpdateMatrix()
{
	static rvector dir,up,right;

	dir=-Normalize(m_dir);
	right=Normalize(CrossProduct(dir,m_up));
	up=Normalize(CrossProduct(right,dir));
	mat._11=right.x;mat._12=right.y;mat._13=right.z;
	mat._21=dir.x;mat._22=dir.y;mat._23=dir.z;
	mat._31=up.x;mat._32=up.y;mat._33=up.z;
	mat._41=position.x;mat._42=position.y;mat._43=position.z;

	matm=MatrixMult(MatrixMult(RotateYMatrix(RoleFactor),
		ScaleMatrixXYZ(ScaleFactorX,ScaleFactorY,ScaleFactorZ)),mat);
	if(parent)matm=MatrixMult(matm,parent->GetMatrix());
	LastFrame=RSFrameCount;

}
Beispiel #5
0
void
APITestUtil::COSTests()
{
	// now let's build a test object
	NURBSSet nset;
	Matrix3 mat;
	mat.IdentityMatrix();

	// build a cv surface
	int cvSurf = MakeTestCVSurface(nset, mat);

	// Now an Iso Curve on the CV surface
	int isoCrv1 = MakeTestIsoCurveU(nset, cvSurf);

	// Now an Iso Curve on the CV surface
	int isoCrv2 = MakeTestIsoCurveV(nset, cvSurf);

	// build a CV Curve on Surface
	int cvCOS = MakeTestCurveOnSurface(nset, cvSurf);

	// build a Point Curve on Surface
	int pntCOS = MakeTestPointCurveOnSurface(nset, cvSurf);

	// build a Surface Normal Offset Curve
	int cnoCrf = MakeTestSurfaceNormalCurve(nset, cvCOS);

	// build a surface surface intersection curve
	int cvSurf1 = MakeTestCVSurface(nset, TransMatrix(Point3(0.0, 0.0, -30.0)) * RotateYMatrix(0.5));
	int intCrv = MakeTestSurfSurfIntersectionCurve(nset, cvSurf, cvSurf1);

	// Vector Projection Curve
	int cvCrv1 = MakeTestCVCurve(nset, TransMatrix(Point3(-100, -200, 40)));
	int vecCrv = MakeTestProjectVectorCurve(nset, cvSurf, cvCrv1);

	// Normal Normal Curve
	int cvCrv2 = MakeTestCVCurve(nset, TransMatrix(Point3(0, -250, 10)));
	int nrmCrv = MakeTestProjectNormalCurve(nset, cvSurf1, cvCrv2);


	Object *obj = CreateNURBSObject(mpIp, &nset, mat);
	INode *node = mpIp->CreateObjectNode(obj);
	node->SetName(GetString(IDS_COS_TEST_OBJECT));
	mpIp->RedrawViews(mpIp->GetTime());
}
Beispiel #6
0
void RSBase3D::AddRotationY(float theta)
{
	mat=MatrixMult(RotateYMatrix(theta),mat);
	GetDirectionVectors();
}