示例#1
0
void Compute_Coordinate_Transform(TRANSFORM *trans, const VECTOR origin, VECTOR up, DBL radius, DBL length)
{
	TRANSFORM trans2;
	VECTOR tmpv;

	Make_Vector(tmpv, radius, radius, length);

	Compute_Scaling_Transform(trans, tmpv);

	if (fabs(up[Z]) > 1.0 - EPSILON)
	{
		Make_Vector(tmpv, 1.0, 0.0, 0.0);
		up[Z] = up[Z] < 0.0 ? -1.0 : 1.0;
	}
	else
	{
		Make_Vector(tmpv, -up[Y], up[X], 0.0);
	}

	Compute_Axis_Rotation_Transform(&trans2, tmpv, acos(up[Z]));

	Compose_Transforms(trans, &trans2);

	Compute_Translation_Transform(&trans2, origin);

	Compose_Transforms(trans, &trans2);
}
示例#2
0
void Camera::Scale(const VECTOR Vector)
{
	TRANSFORM Trans;

	Compute_Scaling_Transform(&Trans, Vector);
	Transform(&Trans);
}
示例#3
0
文件: atmosph.cpp 项目: Degot/povray
void Scale_Skysphere(SKYSPHERE *Skysphere, const VECTOR Vector)
{
	TRANSFORM Trans;

	Compute_Scaling_Transform(&Trans, Vector);

	Transform_Skysphere(Skysphere, &Trans);
}
示例#4
0
void Scale_Camera(CAMERA *Camera, VECTOR Vector)
{
  TRANSFORM Trans;
  
  Compute_Scaling_Transform(&Trans, Vector);
  
  Transform_Camera(Camera, &Trans);
}