how i can to load a texture?

Hi everybody,
I would like to make know how I can load a texture of my models?I see the egg-palletize, but i don’t understand how it works?

Thanks for the attenction and have a nice day.

Have you read the manual on “Texturing”, and looked through the samples to see how they do it?

texture = loader.loadTexture("yourtexture.png")

hi. this is covered in the manual. section textures. have a look at it ->

palletize and the such are special cases. you dont need to care about it you know you have to care bout.

Thanks for all for the attenction, this can help me a lot, but i have other question, what i have to import for the can support the load the texture ?

Thanks the attenction again.

I don’t understand the question. I assume you mean to ask what kind of image formats Panda3D supports?

More than you’ll ever need:
.png, .jpg, .jpeg, .tiff, .tif, .tga, .img, .rgb, .rgba, .sgi, .pic, .soft, .bmp, .pbm, .pgm, .ppm, .pnm, not including also video textures.
.dds support is also on the way, btw.

thanks for whole help!?
That really help me a LOT!?

Have a nice day for all.
Sorry for anything.

Since this topic is about texturing, I can aks my question here I guess…

I’ve loaded a model, which is a heightmap created with 3d’s max. But When I load it, the model uses just 1 time my texture. So it’s stretched out over my model. How to repeat the texture?

This is what I use:

hm = loader.loadModel("mystuff/heightmap")



hm.setTexScale(TextureStage.getDefault(), 5,5)


It returns me an error.

TextureStage not defined

In that case, you need to import it:

from pandac.PandaModules import TextureStage

or just:

from pandac.PandaModules import *


Great, it worked. Could you tell explain this for me:

hm.setTexScale(TextureStage.getDefault(), 5,5)

What is the texturestage.getDefault, and what does the numer 5?

Hmm… When I try to scale the texture, it doesnt work…! But it doesnt return an error, it just doesn’t rescale.

TextureStage.getDefault() is the pointer to the standard TextureStage, which is how you refer to your texture unless you have specified a different TextureStage. (TextureStages are useful for applying multitexture.)

5 is the number of times to repeat the texture. I picked 5 because you had scaled your object by 5. You could pick a different number.

All of this is already documented in the manual. See: