Closed andrasf closed 3 years ago
the right or bottom pixels are getting repeated in stripes.
Hmm, this never happened to me before, could you share a reproducible example?
Hi!
I modified 3d-model.html to show the problem. Maybe I am missing something very basic.
When I put the video into a canvas, and set the canvas 1px larger than the video, it looks like if the bottom 1 px of the canvas is a solid red color, the whole projected image is red.
Commit is here: https://github.com/marcofugaro/three-projected-material/compare/master...andrasf:master
AndrĂ¡s
I have a similar issue where the y axis isn't seemingly being scaled so you end up with what looks like a stripe, the video is playing as the colours change correctly.
Hi @marcofugaro, thank you very much for this very cool lib. I really appreciate your work. Do you have any clue, why this could happen? Did you ever manage to get it running with a video texture?
Thanks
The problem is in computeScaledDimensions.
ratio
will be nan
because texture.image
is a video element that doesn't support natrualWidth
function computeScaledDimensions(texture, camera, textureScale, cover) {
// return some default values if the image hasn't loaded yet
if (!texture.image) {
return [1, 1];
}
const ratio = texture.image.naturalWidth / texture.image.naturalHeight;
Fixed in v2.0.2
!
Thanks for the tip @CptCompiler, we now have a working video example:
https://marcofugaro.github.io/three-projected-material/video
Hey @marcofugaro, thank YOU for your quick fix!! I am so happy :-)
Hi!
I would like to project a VideoTexture to a 3d model. Should it be possible with this library? In theory the classes act the same. But seems like only the right or bottom pixels are getting repeated in stripes.
Thanks, AndrĂ¡s