添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
严肃的筷子  ·  Webcam input three.js ...·  1 周前    · 
怕老婆的西装  ·  Ljtheg Female ...·  7 月前    · 
灰常酷的小马驹  ·  Webcam - present or ...·  1 年前    · 
孤独求败  ·  Webcam Model ...·  1 年前    · 
1290183444  ·  Webcam Model ...·  1 年前    · 
任性的数据线  ·  Monica 7 Light Flush ...·  2 月前    · 

Hi there,

I’d like to use webcam input for my next project. I’ve seen some examples but is there somewhere a good and clear tutorial or source code that I can look at? So far I’ve not found anything that is helpful for me.

Many thanks in advance

The idea is to create a texture with this image so that the webcam input merges with it if that makes any sense?? camtexture

https://www.yuichiroharai.com/experiments/fluid/ <— a bit like this but with the image above…

var videoTexture, videoSettings;
navigator.mediaDevices.getUserMedia({video: true}).then(function(stream) {
	videoSettings = stream.getVideoTracks()[0].getSettings();
	let video = document.createElement("video");
	Object.assign(video, {
		srcObject: stream,
		//height: videoSettings.height,
		//width: videoSettings.width,
		autoplay: true
	//document.body.appendChild(video);
	videoTexture = new THREE.VideoTexture(video);
	videoTexture.minFilter = THREE.LinearFilter;
	init();
	).catch(function(error){console.error(error);});

Now the videoTexture containing the live webcam can basically be treated as any other texture, so that you can blend it with other images in a shader, apply post-processing etc. :slight_smile:

Hi Michael,
Please, is there any alternative for rev 156.
I could not connect my PC camera.
PS: works in Webcam ghost effect

@jrlazz are you referring to this example three.js examples? this should work as expected in the latest versions, have you previously denied permissions for webcam access? also if you can let us know which browser / system you’re using? if this is not the example in question could you elaborate on which part of the thread you’re referring to?

Thank You Lawrence… Now I saw many images. :slightly_smiling_face:
Here:
https://threejs.org/examples/#webgl_materials_video_webcam

In fiddle I did not see.
I will try to get the code to run the page locally.
Thank You very much!

After copying and running locally I did not see the camera image. :roll_eyes:
I will try to see if some changes bring it.

In Firefox:
Uncaught (in promise) TypeError: URL.createObjectURL: Argument 1 is not valid for any of the 1-argument overloads.

In Chrome:
Uncaught (in promise) TypeError: Failed to execute ‘createObjectURL’ on ‘URL’: Overload resolution failed.

Thank You for the attention!

@Lawrence3DPK

Please take a look at this page, made after many experiences, and write me if it worked correctly.

the link

https://jrlazz.eu5.org/anim/ontv.html

the link was corrected :wink:

I have corrected the link:

https://jrlazz.eu5.org/anim/ontv.html

There were two points after the link…

Please confirm if it works!

PS: There is another post about it:

Live on an old TV set, with webcam and animated canvas textures Much based in video (mp4) as texture for a plane, and partially based on Webcam ghost effect the link: https://jrlazz.eu5.org/anim/ontv.html Three.js Forever !!! Jose Roberto Lazzareschi … jrlazz … November, 27, 2023 [ontv]