Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
suhasasumukh authored Feb 7, 2024
1 parent c870eaf commit d481fba
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions AI/rubiks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

function hexToRgb(hex) {
if (hex.length == 7) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
Expand Down Expand Up @@ -43,10 +42,7 @@ arrayFindIndex = function (arr, f) {
return -1;
};
var xAutorotate = 0, yAutorotate = 0, zAutorotate = 0;
// row implied as [0, 0, 0, 1]. This is to avoid generally unneeded work,
// homogeneous divide. Unlike points, we use a constructor function instead
// e0 e1 e2 e3
// e8 e9 e10 e11

function AffineMatrix(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) {
this.e0 = e0;
this.e1 = e1;
Expand Down Expand Up @@ -118,11 +114,6 @@ function makeRotateAffineZ(theta) {
0, 0, 1, 0
);
}
// e4 e5 e6 e7
// 0 0 0 1
// d e f * y = (xd + ye + zf)

// m n o * (xd + ye + zf)

function transformPoint(t, p) {
return {
Expand Down Expand Up @@ -176,7 +167,6 @@ var Point = function (parent, xyz, project, rubiks) {
};
Point.prototype.projection = function () {
var p = transformPoint(this.cube.rotationAffine, { x: this.xo, y: this.yo, z: this.zo });
// p = transformPoint(affine, p);
p = transformPoint(this.rubiks.cameraAffine, p);
p = transformPoint(this.rubiks.customAffine, p);
if (this.rubiks.affinediff) {
Expand Down Expand Up @@ -982,4 +972,4 @@ RubiksCube.prototype.getState = function () {
})

return result.trim();
}
}

0 comments on commit d481fba

Please sign in to comment.