XML Feeds

.

[javascript-dev] Video Texture on OpenGL in Javascript

Wesley Smith wesley.hoke at gmail.com
Fri Nov 16 21:15:09 MST 2007


the texture attribute takes a string of the texture name, not the object itself.

mywidget.texture = tex1.name;

wes


On 11/16/07, Andrew Roth <aroth21 at rogers.com> wrote:
>
> How do I apply a video texture to openGL objects in Javascript?  I've looked through the documentation and can't seem to find it.
>
> I'm just modifying tutorial 47 at the moment, this is what I have so far.  I think i'm just missing a name but I'm not sure the syntax for arguements in GL objects:
>
> //set video texture from movie
> var myvideo = new JitterObject("jit.qt.movie", 320, 240);
> //set Matrix for video
> var mymatrix = new JitterMatrix(4, "char", 320, 240);
> //Read a movie
> function read(filename)
> {
> if(arguments.length==0) {
> //no movie specified, so open a dialog
> myvideo.read();
> }
> else {myvideo.read(filename);
> }
> }
> //create texture
> var tex1 = new JitterObject("jit.gl.texture", "ListenWindow");
>
> // create a [jit.gl.gridshape] object for use to control with the mouse
> var mywidget = new JitterObject("jit.gl.gridshape","ListenWindow");
> mywidget.shape = "sphere";
> mywidget.lighting_enable = 1;
> mywidget.smooth_shading = 1;
> mywidget.texture = tex1;
> mywidget.scale = [0.1,0.1,0.1];
> mywidget.color = [1,1,1,0.5] ;
> mywidget.blend_enable = 1;
> mywidget.position = [0,0];
> _______________________________________________
> javascript-dev mailing list
> javascript-dev at cycling74.com
> http://www.cycling74.com/mailman/listinfo/javascript-dev
>


More information about the javascript-dev mailing list