Forums > Javascript

White squares flickering

April 30, 2009 | 6:47 pm

I have written simple JavaScript program to load a textures and rotate the plane after looking at several examples in the forum
When I run it the program does work but I can see some white squares flickering all over the window and loaded texture looks different.
What did I do wrong?

inlets = 1;
outlets = 1;

//jit window
var mywindow = new JitterObject("jit.window","test");
mywindow.depthbuffer = 1;
mywindow.doublebuffer = 1;
mywindow.size = [1000,800];

//render
var myrender = new JitterObject("jit.gl.render","test");
myrender.ortho = 2;
myrender.camera =[0, -10, 20];
myrender.lookat= [0, 0, 0];
myrender.far_clip = 1000;
myrender.erase_color = [0,0,0,1];

var mywallpaper = new JitterObject("jit.gl.texture","test");
mywallpaper.name = "wallpaper";
mywallpaper.read("skin2.tif");

var planepaper = new JitterObject("jit.gl.gridshape","test");
planepaper.shape = "plane";
planepaper.lighting_enable = 1;
planepaper.smooth_shading = 1;
planepaper.color = [1,1,1,1];
planepaper.position = [0,0];
planepaper.blend_enable = 1;
planepaper.texture = "wallpaper";

var small_amt = 1.1;
var ang =0;

function bang()
{

ang += small_amt ;
if (ang > 360)
ang -= 360;

planepaper.rotate = [ang, 0, 0, 1];

myrender.erase();
myrender.drawclients();
myrender.swap();

}

– Pasted Max Patch, click to expand. –

Viewing 1 post (of 1 total)