I am trying to build an app that would allow users to paint colors and images on models using just WebGL (no three.js). I have all the rendering stuff set up. I know that painting on 3d objects have something to do with the stencil buffer but I am not sure how it looks in the code. I also want to draw images onto the models, so I guess the brush should be an image.
Any outline code for handling the painting would be good for me.
I am not asking for the full code. just something that would get me started. Some thing like ‘do this and then do that’. I searched on google for the topic. I could only get a github repository that did it all but it had no explanation on how it all worked.
Also, the principles would be same for three.js and for just using webgl, so I don’t think it was a bad idea to ask here.
yes you can, but that requires carefully unwrapped object with as little seams as possible. 3js now returns UV of the clicked point, with these you can alter the pixel under mouse in the texture
Hi,
I’m very interested in this.
am i missing something with the scanned head link, instructions etc?
is there a repo for all of this? open source?
thanks!
$ git clone git@github.com:sciecode/three.js.git
Cloning into 'three.js'...
remote: Enumerating objects: 307442, done.
remote: Total 307442 (delta 0), reused 0 (delta 0), pack-reused 307442
Receiving objects: 100% (307442/307442), 1.16 GiB | 3.52 MiB/s, done.
Resolving deltas: 100% (226751/226751), done.
Updating files: 100% (4565/4565), done.
$ cd three.js/
$ git checkout -b texture-painter f4e363a8e0cf6c496f4191192d7eb15110442a7c
fatal: reference is not a tree: f4e363a8e0cf6c496f4191192d7eb15110442a7c
$ git reset --hard f4e363a8e0cf6c496f4191192d7eb15110442a7c
fatal: Could not parse object 'f4e363a8e0cf6c496f4191192d7eb15110442a7c'.
edit 2: so I saved it to new github repo and did a patch to work with current 3js. while reading the source, I have noticed there is a kind of wtf texture-related moment that I want to fix too, but it will have to wait.