PDA

View Full Version : Need ideas on how to "spray paint" object



cthulhu666
09-05-2002, 04:26 AM
Hi

First of all I'd like to apologize for posting this in the "Advanced" forum, but I'm afraid I need some expert help.

I'm writing a program that's supposed to simulate and display objects that are spray painted by a robot. Ideas that can be used to make a play/pause/play backwards player would be highly appreciated.

I've thought about how to apply the "paint" and I've come up with the following ideas:
1. Use colored lights and then try to "store the lighting"
2. Some sort of raytracing (?)
3. Do it manually and only use OpenGL to display it.

Any ideas, comments and the like very welcome.

Thanks in advance.

Cthulhu

MikeC
09-05-2002, 03:16 PM
If you have (or can fake) render-to-texture, how about accumulating the paint by splatting alpha-blended GL_POINTS or sprites onto a texture, then applying the texture to the object?

If you store the individual splatted-point positions in an array/vector/list/deque/whatever, you could then implement rewind etc by rebuilding the texture with only a subrange of those points.
Not as fast as incremental updates, but if that becomes a major problem you could maybe cache snapshots at regular intervals to reduce the amount of rebuilding needed per frame.

[EDIT: I was originally thinking cubemaps, but that's not going to work too well if your object isn't a convex hull.)


[This message has been edited by MikeC (edited 09-05-2002).]

JasonM [ATI]
09-05-2002, 10:21 PM
Probably worth checking out...Takeo Igarashi's Chameleon (http://www.mtl.t.u-tokyo.ac.jp/~takeo/chameleon/chameleon.htm) project (read the I3D paper) addresses some interesting usability issues related to this topic.

-Jason

cthulhu666
09-05-2002, 10:48 PM
Originally posted by MikeC:
[B]If you have (or can fake) render-to-texture, how about accumulating the paint by splatting alpha-blended GL_POINTS or sprites onto a texture, then applying the texture to the object?

If you store the individual splatted-point positions in an array/vector/list/deque/whatever, you could then implement rewind etc by rebuilding the texture with only a subrange of those points.
Not as fast as incremental updates, but if that becomes a major problem you could maybe cache snapshots at regular intervals to reduce the amount of rebuilding needed per frame.

[EDIT: I was originally thinking cubemaps, but that's not going to work too well if your object isn't a convex hull.)[B]
MikeC, are you from NVnews??? http://www.opengl.org/discussion_boards/ubb/cool.gif

I'm thinking something along the lines of render-to-texture, but I'm a bit unclear about unique texture areas on the object. In order to get reliable results, I have to be able to assign a unique texture area to every area on the object and I gotta admit I'm kind of new to texture mapping.

For the rewind function I was playing with the idea of "painting" with the "inverted" color.

I'm afraid that I don't really understand cubemaps, but I don't think I can garantie that the objects will be convex either http://www.opengl.org/discussion_boards/ubb/frown.gif

I have to admit, I was pretty desperate about getting some feddback, so I doubleposted this topic both here and in the Beginners section. Maybe we should keep all replies in one thread? Since I'm actually a beginner I suggest keeping all feedback in this thread (http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/009795.html) . I'd still like all the advices you experts can give me http://www.opengl.org/discussion_boards/ubb/smile.gif