Forums > Jitter

Open Gl and Javascript

May 28, 2007 | 5:48 pm

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


May 28, 2007 | 6:09 pm

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
> ———————————–
>


May 28, 2007 | 7:00 pm

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.


Viewing 3 posts - 1 through 3 (of 3 total)