Open Gl and Javascript

May 28, 2007 at 5:48pm

Open Gl and Javascript

Nobody answer so I post this again:

I’m playing around with one of the Js example: js jsglnurbstendril.js

It’s quite a nice example actually, but I’m trying to move the camera position, angle, etc… In the Java script a jit.gl.render object is created, so in order to move the cam I was trying to put in the patch a jit.gl.render and give it the same name as in the Js but it doesn’t work (maybe some conflict with the object created by the Js?).

And I was trying to add a function in the Js so I would have an input like (pak camera 0. 0. 0.), but I’m not so good with Js… just starting this part…

Anyway since none of this worked, If you guys can help me?

cheers,

Ben

#32151
May 28, 2007 at 6:09pm

As a general rule, only use one jit.gl.render object per context. To
make a function for camera, try something like this

function camera(vals)
{
//see the JS docs for info about arrayfromargs
render.camera = arrayfromargs(arguments);
}

On 5/28/07, recyclism

wrote:
>
> Nobody answer so I post this again:
>
> I’m playing around with one of the Js example: js jsglnurbstendril.js
>
> It’s quite a nice example actually, but I’m trying to move the camera position, angle, etc… In the Java script a jit.gl.render object is created, so in order to move the cam I was trying to put in the patch a jit.gl.render and give it the same name as in the Js but it doesn’t work (maybe some conflict with the object created by the Js?).
>
> And I was trying to add a function in the Js so I would have an input like (pak camera 0. 0. 0.), but I’m not so good with Js… just starting this part…
>
> Anyway since none of this worked, If you guys can help me?
>
> cheers,
>
>
> Ben
> –
> ———————————–
> art: http://www.recyclism.com
> recycling: http://www.digitalrecycling.com
> collective: http://www.deponk.com
> ———————————–
>

#105285
May 28, 2007 at 7:00pm

brilliant ! it works…
And I’ve added this for the lookat message:

function lookat(vals)
{
//see the JS docs for info about arrayfromargs
render.lookat = arrayfromargs(arguments);
}

Thanks I was stock there ;-)

b.

#105286

You must be logged in to reply to this topic.