broken implementation of encoding camera transform data
This commit is contained in:
parent
5905b15c3a
commit
6e2f9688ed
@ -95,8 +95,24 @@ public class RT3script : MonoBehaviour
|
||||
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
|
||||
outputImage.Apply();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user