PDA

View Full Version : Painting on 3D models



NecroDOME
25-03-2009, 09:09 AM
Hi all,

I made a simple test on how to draw pixels directly on a 3D model.
http://www.necrosoft.nl/wp-content/uploads/2009/03/3dpaint1.jpg

The full article how it works is located here: http://www.necrosoft.nl/?p=301

pstudio
25-03-2009, 09:36 AM
Looks interesting. Perhaps you could work a bit more on the picking technique and then write an article for Will's Pascal Mag?

WILL
25-03-2009, 09:08 PM
Looks interesting. Perhaps you could work a bit more on the picking technique and then write an article for Will's Pascal Mag?


I second that! :D Could work for a section in the mag that covers small tips and tricks. aka 'How To Do All Kinds of Small and Cool things'

chronozphere
25-03-2009, 10:43 PM
Hey man.. Nice technique. :yes:

I wouldn't have thought of this approach. I'd have done it like this:

> Cast a ray into the scene and pick the first triangle
> Determine the UV-coordinate of the ray by using the three UV-pairs of the triangle (We may need barycentric coordinates here, not sure).
> Lock the texture and paint the pixel at that UV-coordinate.

This works for a simple pen tool. If you want lines and brushes, you need to do more, like take the viewing angle of a triangle into account, and take care of any pixels drawn on adjacent triangles. To summarize, it would be awefully tedious to implement, but VERY cool if succesfull.

I'm sure there are more approaches, but i think this one is kinda original. :) It might need further optimization though.

Nice work.

NecroDOME
26-03-2009, 08:32 AM
Yup,it can be done by ray picking triangles, but this works for everything, every model and high poly models without optimization or intensive calculations. It's just a pixel lookup under the mouse. And it's also pixel-precise.
With some modifications I can make it more precise on large textures also.

NecroDOME
13-04-2009, 10:15 AM
Ok, I made some changes and added a movie on youtube.

http://www.youtube.com/watch?v=xegY7AKdt-Y

chronozphere
13-04-2009, 11:46 AM
wow... pretty neat stuff. :)