broken implementation of encoding camera transform data

This commit is contained in:
RopeBunnyVJ 2025-02-23 23:50:38 -08:00
parent 5905b15c3a
commit 6e2f9688ed

View File

@ -95,8 +95,24 @@ public class RT3script : MonoBehaviour
colors[j] = Color.black; colors[j] = Color.black;
} }
} }
outputImage.SetPixels(0,0,cameraList.Length,1, colors); outputImage.SetPixels(0,outputImage.height-1,8,1, colors);
} }
//encode into pixels this camera's coordinates
var encodedTransform = new Color[256];
var tr = cameraList[i].transform.localToWorldMatrix;
for (int j = 0; j < 256; j++) {
//this logic does a bitwise check on the length value at bit j
if ((((int)tr[0,0] >> j) & 1)==1) {
encodedTransform[j] = Color.white;
}
else {
encodedTransform[j] = Color.black;
}
}
outputImage.SetPixels((256*i),outputImage.height-2,256,1, encodedTransform);
//encode into pixels transform matrix for this camera //encode into pixels transform matrix for this camera
outputImage.Apply(); outputImage.Apply();