Merge JigsawX

This commit is contained in:
2022-06-26 19:53:26 +00:00
parent d739f2a6cf
commit 41af3009bb
48 changed files with 8654 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package utils;
typedef Point2D =
{
var x: Float;
var y: Float;
}
typedef Point3D =
{
> Point2D,
var z : Float;
}
class Simple3D
{
public static inline var fl: Float = 420;
public function new()
{
}
public static inline function scale( z: Float )
{
return 1-(-z)/fl;
}
public static inline function twoD( p: Point3D ): Point2D
{
var s = scale( p.z );
return { x: p.x/s, y: p.y/s };
}
public static inline function rgbTwoD( rgb: Array<Float>, offSet: Point2D ): Point2D
{
var s = scale( rgb[2] );
return { x: rgb[0]/s + offSet.x, y: rgb[1]/s + offSet.y };
}
}