JS and jit.gl.text3d

Jan 27, 2009 at 8:48pm

JS and jit.gl.text3d

Hello there,

I’m trying hard to implement a script with JS that takes coordinates and draws some 3d shapes and numbers them. I’ve got the script generating the shapes but I’m stuck in the numbering part with jit.gl.text3d. Basically it refuses to draw anything and it doesn’t spit out an error to the console. Here’s an example of the code, any help appreciated..

var text = new Array(12);

function draw_text()
{
for(var i=1;i<13;i++) {text[i] = new JitterObject("jit.gl.text3d","Render_window");
text[i].text = ‘where am I’;
text[i].position = [1,1,1];
text[i].smooth_shading = 1;
text[i].lighting_enable = 1;
text[i].scale = [0.2,0.2,0.5];
text[i].color = [0,1,0,0.5] ;
}
}

#41963
Jan 27, 2009 at 8:59pm

text is not an attribute.

you want to use text[i].text(“where am I”);

On Jan 27, 2009, at 3:48 PM, polarch wrote:

>
> Hello there,
>
> I’m trying hard to implement a script with JS that takes coordinates
> and draws some 3d shapes and numbers them. I’ve got the script
> generating the shapes but I’m stuck in the numbering part with
> jit.gl.text3d. Basically it refuses to draw anything and it doesn’t
> spit out an error to the console. Here’s an example of the code, any
> help appreciated..
>
> var text = new Array(12);
>
> function draw_text()
> {
> for(var i=1;i<13;i++) {text[i] = new
> JitterObject(“jit.gl.text3d”,”Render_window”);
> text[i].text = ‘where am I’;
> text[i].position = [1,1,1];
> text[i].smooth_shading = 1;
> text[i].lighting_enable = 1;
> text[i].scale = [0.2,0.2,0.5];
> text[i].color = [0,1,0,0.5] ;
> }
> }
>

#149889
Jan 28, 2009 at 11:54pm

thanks a ton Joshua! I’m just starting to get how this object-oriented thing is working…

#149890

You must be logged in to reply to this topic.