我在 C# 中制作了一个简单的 Ray Traycer。对于我的视口,我有一个矩形类。
public class Rectangle3D
{
public readonly Point3D Point1;
public readonly Point3D Point2;
public readonly Point3D Point3;
public readonly Point3D Point4;
public Rectangle3D(Point3D point1, Point3D point2, Point3D point3, Point3D point4)
{
this.Point1 = point1;
this.Point2 = point2;
this.Point3 = point3;
this.Point4 = point4;
}
public Point3D FindCrossPoint(Ray ray)
{
//Intersection
}
我将如何编写这个函数。非常感谢您的帮助。PS Point3D 具有所有需要的功能。比如交叉,归一化等...