Time Texturing - Texture Mapping with Bezier Lines with souce code
Leave a comment
Dive into the source
Disclaimer
I honestly don’t know if this has been done before. It’s certainly nothing you would use in a real-time renderer, but it works. If this has been done before, I’d like to know what the official name is.
What is Time Texturing?
Time Texturing is a texture mapping routine where texture information is drawn based on time. In reality, I am using bezier lines to draw my textures. Or simple put; texture mapping with bezier lines.
Why use Time Texturing?
The main reason was for the same reason why I designed it, it’s easy to implement. I was in the process if creating my own 3d modeling program and was at the texture mapping routine stage.
While out looking for something that worked, I could never find anything that explained texture mapping in a way I could adapt to my own project. There were just too many technical terms, and not enough explaining. Just show some code, (with comments) for crying out loud, that’s all I needed.
So, I figured I already knew how to draw bezier lines. I knew how to draw a triangle. I know all about normalizing. Why not combine everything I know and texture at the same time. Based on how bezier lines worked, I knew I would always be working with a number between zero and one. Converting numbers to texture space would be a snap.
How does it work?
The meat of the routine lies with the bezier line drawing routine. There are two types I uses. One draws the line; the other gets a texture pixel and feeds it to the drawing routine. Repeat these steps over your “time scale” and your texture-mapped triangle is complete.
But will it work for me?
That depends on what your needs are. In my case, I just wanted something that indicated a texture was in place and in the correct position. By lowering the scale factor, I was able to continue modeling, with low impact on frame rate. When I was done, I could pump up the time scale and see the model in all its glory.
Don’t expect to use this routine in some high performance 3d engine; it just doesn’t work that way. Bezier lines are expensive to solve.
Copyright David Fawcett 2007 fawzma.com

