warping texture to a mesh

Hi,

I have a little problem, please have a look at the picture:

So the above (rectangular) texture is rendered off-screen and is in fact the panoramic view of the scene which I can move about in using the keyboard (I have done this).
I would like to apply this texture to a mesh (in a visible window) in the way shown in the picture (i.e. the mesh is a torus). The torus should be stationary but the texture should update every time I move in the off-screen environment (like a rear-view window effect).

Any ideas on how to do this?

Thank you for your help on this!!!

Best Wishes,
Pawel

This is done using UV-mapping, a basic technique used for applying a texture to a mesh.

I’m not exactly sure what you mean when you say updating the texture when you move in the off-screen environment, but if you mean what I think you mean it can probably be done with NodePath.setTexOffset.

As for setting the texture itself, the vertices of your mesh need to have UV coordinates, like rdb said. If it does, you can load the texture with loader.loadTexture and then set it on the mesh with NodePath.setTexture.

Thank you so much for the response…yes this was just a newbie qs and UV-mapping sorts it out…probably many more of these to come.

Thank you for the quick replies :slight_smile:
Pawel