Forums > Javascript

Simple display

May 2, 2009 | 6:43 pm

I am writing a simple program in javascript to display some object using jit.gl.sketch. I have looked at some example on the forum and wrote this. There are no errors but nothing is shown also. What did I do wrong?

inlets = 1;
outlets = 1;

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

var myrender = new JitterObject("jit.gl.render","test");
myrender.ortho = 2;
myrender.erase_color = [0.1,0,0.4,1];
myrender.lighting_enable = 1;

var sketch = new JitterObject("jit.gl.sketch","test");

function bang()
{

sketch.glmatrixmode("modelview");
sketch.glpushmatrix();
sketch.glrotate(10,1.,0.,0.);
sketch.glrotate(10,1.,1.,0.);
sketch.glrotate(10,0.,0.,1.);
sketch.torus(0.5,0.2);
sketch.glpopmatrix();

}

– Pasted Max Patch, click to expand. –

Viewing 1 post (of 1 total)