예제 #1
0
// This matrix is TShift(-px,-py,-pz) * TScale(sx,sy,sz) * TShift(px,py,pz)
TPivotScale::TPivotScale(Real sx, Real sy, Real sz, const TVector &p) :
TScale(sx, sy, sz)
{
	mat[3][0] = (1 - sx) * p.CrdX();
	mat[3][1] = (1 - sy) * p.CrdY();
	mat[3][2] = (1 - sz) * p.CrdZ();
}
예제 #2
0
TPolyhedron *TMaze::NewCrystal() // Creates new crystal
{
	TPolyhedron *p = new TPolyhedron("Crystal.Dat");

	Assert(p);

	// New destination coordinate
	Dest = Random();
	TVector v = Maze.Vector(Dest.CrdX(), Dest.CrdY(), Dest.CrdZ());

	*p *=
	 TPivotScale(0.2, 0.2, 0.2, TVector()) *
	 TShift(v.CrdX(), v.CrdY(), v.CrdZ());

	return p;
}