本文整理汇总了C#中Point3.RotateLikeZVector方法的典型用法代码示例。如果您正苦于以下问题:C# Point3.RotateLikeZVector方法的具体用法?C# Point3.RotateLikeZVector怎么用?C# Point3.RotateLikeZVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point3
的用法示例。
在下文中一共展示了Point3.RotateLikeZVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestRotateLikeZVector
public void TestRotateLikeZVector()
{
Point3 norm;
Random rand = new Random();
for(int i = 0x00; i < TestParameters.PointTest; i++) {
double x = 200.0*rand.NextDouble()-100.0d;
double y = 200.0*rand.NextDouble()-100.0d;
norm = new Point3(0.0d, 0.0d, 1.0d);
double rinv = 1.0d/Math.Sqrt(x*x+y*y+1.0d);
norm.RotateLikeZVector(x, y);
Assert.IsTrue(Math.Abs(norm.X-x*rinv) <= Math.Sqrt(Maths.GlobalEpsilon));
Assert.IsTrue(Math.Abs(norm.Y-y*rinv) <= Math.Sqrt(Maths.GlobalEpsilon));
Assert.IsTrue(Math.Abs(norm.Z-rinv) <= Math.Sqrt(Maths.GlobalEpsilon));
}
}
示例2: TweakNormal
public void TweakNormal(Point3 tu, Point3 normal, Point3 bumpx, Point3 bumpy)
{
int y = Maths.Border(0x00, (int)Math.Round(Height*tu.Y), Height-0x01);
int x = Maths.Border(0x00, (int)Math.Round(Width*tu.X), Width-0x01);
int x0 = (x+Width-0x01)%Width;
int y0 = ((y+Height-0x01)%Height)*Width;
y *= Width;
double xdiff = ((int)(Pixel[y+x]&0xff)-(int)(Pixel[y+x0]&0xff))/255.0d;
double ydiff = ((int)(Pixel[y+x]&0xff)-(int)(Pixel[y0+x]&0xff))/255.0d;
normal.RotateLikeZVector(xdiff, ydiff);
}