Reply To: Aircraft textures
Home › Forums › Previous Months › 29 – June 2019: Knights of the Sky › Aircraft textures › Reply To: Aircraft textures
![](https://www.dosgameclub.com/wp-content/uploads/2017/04/kdrnic_avatar-80x80.png)
kdrnic
Managed to get a similar point cloud now:
bin = ReadFile("fokker.rb");
_idx = 256;
_offs = 0;
var signed = true;
var short = true;
var endian = false;
var old_buttons = 0;
function Loop(){
ClearToColor(screen, 0);
_idx += dpad[0].x * 0.1;
_offs += dpad[0].y;
var idx = Math.floor(_idx);
var offs = Math.floor(Math.abs(_offs));
var pressed = buttons[0] & (~old_buttons);
old_buttons = buttons[0];
if(pressed & BUTTON_A) signed = !signed;
if(pressed & BUTTON_B) short = !short;
if(pressed & BUTTON_X) endian = !endian;
//for(var i = 0; i + idx < bin.length; i += 3 * (short ? 2 : 1) + offs){
for(var i = 0; i < 128; i++){
x = bin[idx + i * (3 * (short ? 2 : 1) + offs) + 0 * (short ? 2 : 1) + (endian ? 0 : 1)];
y = bin[idx + i * (3 * (short ? 2 : 1) + offs) + 1 * (short ? 2 : 1) + (endian ? 0 : 1)];
z = bin[idx + i * (3 * (short ? 2 : 1) + offs) + 2 * (short ? 2 : 1) + (endian ? 0 : 1)];
if(signed){
if(x > 127) x -= 256;
if(y > 127) y -= 256;
if(z > 127) z -= 256;
x += 127;
y += 127;
z += 127;
}
dx = bin[idx + i * (3 * (short ? 2 : 1) + offs) + 0 * (short ? 2 : 1) + (endian ? 1 : 0)];
dy = bin[idx + i * (3 * (short ? 2 : 1) + offs) + 1 * (short ? 2 : 1) + (endian ? 1 : 0)];
dz = bin[idx + i * (3 * (short ? 2 : 1) + offs) + 2 * (short ? 2 : 1) + (endian ? 1 : 0)];
x += dx / 256;
y += dy / 256;
z += dz / 256;
var t = 256, s = 3;
x *= s;
y *= s;
z *= s;
x -= t;
y -= t;
z -= t;
var c = 0xFFFFFF;
PutPixel(screen, x, y, c);
PutPixel(screen, x + 256, z, c);
PutPixel(screen, y, z + 256, c);
}
TextOut(screen, "IDX : " + idx, 256, 256, 0xFFFFFF);
TextOut(screen, "OFFS : " + offs, 256, 256 + 8, 0xFFFFFF);
TextOut(screen, "LEN : " + bin.length, 256, 256 + 16, 0xFFFFFF);
TextOut(screen, "SHORT " + short + " SIGN " + signed, 256, 256 + 16 + 8, 0xFFFFFF);
TextOut(screen, "ENDIAN " + endian, 256, 256 + 16 + 16, 0xFFFFFF);
}