How to make a scrolling texture for conveyor belt

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

You can throw this idea out the window if you want, but, have you thought about placing a color on your belt? Then if you want, say a line down the middle of the belt, draw that with a 2dline. (don't ask me how tho)
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Post by Eternl Knight »

I don't know if it is currently possible in Irrlicht (I haven't looked), but I tend to do these types of operations using a texture matrix. If you're willing to waste GPU cycles on it - you could use a pixel shader (using a parameter for texture translation) but I think that texture matrices (implemented already or not) are what you're after...
Guest

Post by Guest »

krama757 wrote:Emils library allows you to do what irrlicht doesnt. If you see some of his examples he combines 2D and 3D....I believe you can load an animated gif or even an avi file as a skin for a mesh.
It does, clever as I am I googled for this library and came up with nothing, because I assumed it was a standalone library for 2D stuff, not a specific library to extend Irrlicht. Though there is still the issue that it would be wasting a lot of memory and would require adjusting the play speed to the belt movement.

It wouldn't be hard to add a simple function to just call:
driver->setTextureMatrix(some_matrix)

But it would still have to be done right before this particular (sub)mesh is rendered and reset afterwards. So, one way or another the belt must be its own node with its own material or render function.
Post Reply