Adding Video Texture?

42 views
Skip to first unread message

Sean Shoats

unread,
Jan 27, 2013, 12:23:29 PM1/27/13
to pr...@googlegroups.com
Hello, is there a way to add video texture to pre3d..?? thanks

Dean

unread,
Jan 27, 2013, 9:06:15 PM1/27/13
to pr...@googlegroups.com
You can just pass a <video> tag instead of an image. When the texture
is drawn it will take the current frame from the video.

On Sun, Jan 27, 2013 at 6:23 PM, Sean Shoats <seanac...@gmail.com> wrote:
> Hello, is there a way to add video texture to pre3d..?? thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "pre3d" group.
> To post to this group, send email to pr...@googlegroups.com.
> To unsubscribe from this group, send email to
> pre3d+un...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pre3d?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Sean Shoats

unread,
Jan 28, 2013, 7:59:11 AM1/28/13
to pr...@googlegroups.com
Hey Dean, thanks, ok I just tried adding my video tag to the image src but its not working.. here;s what I got so far


var img = new Image();
img.onload = function() { start3d(img); };
img.src = '<video></video>'; etc....  

I've using your texture cube page for an example...   should I put the video elements inside also such as:

<video id="myvid" width="320" height="240" controls>
  <source src="video/Myvideo.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Dean

unread,
Jan 28, 2013, 8:31:45 AM1/28/13
to pr...@googlegroups.com
You do not create an Image(), this creates an HTMLImageElement. You
are incorrectly setting the video as a source to the image element.
Just pass an HTMLVideoElement to pre3d, for example,
start3d(document.getElementsByTagName('video')[0])

Sean Shoats

unread,
Jan 28, 2013, 10:16:54 AM1/28/13
to pr...@googlegroups.com
Thanks alot for pointing out that error out, I've made a  jsfiddle to the video texture im having problems with... I've added the HTMLVideoElement to pre-3D.. I'm just not sure to what properties or attributes should I add it to.. 
The jsfiddle is below.... thanks!

Dean

unread,
Jan 28, 2013, 10:21:07 AM1/28/13
to pr...@googlegroups.com
Sorry that I will not be able to help you debug and better learn
JavaScript. However I can quickly look and tell you that
getElementsByTagName returns a NodeList, which is why you should take
the first element of it, or look up the element in a different way. I
would suggest getting a good book on JavaScript and the DOM.

Good luck,
Dean

Sean Shoats

unread,
Feb 1, 2013, 8:28:57 PM2/1/13
to pr...@googlegroups.com
No problem Dean, Thanks for your help... Your right I defintely have to better learn javascript, I just brought Nicholas C. Zakas (Javascript For Developers) as I will be learning javascript effectively... The good thing about your Pre3D rendering engine is its really not that difficult to learn  as it uses javascript to draw 3d in any browser... verses other engines such as webgl, thre..js etc..... Wish me luck!! :)
Reply all
Reply to author
Forward
0 new messages