Problem with texturing

I’m sure it’s quite simple but I made mistake somewhere here and I can’t find it.

Here’s my code:

import direct.directbase.DirectStart
from pandac.PandaModules import *

from direct.task import Task
from direct.interval.IntervalGlobal import *
import math

teapot = loader.loadModel('teapot.egg')
teapot.setScale(0.5, 0.5, 0.5)
tex = loader.loadTexture('maps/noise.rgb')

smiley = loader.loadModel('smiley.egg')
smiley.setTexture(tex, 1)

def SpinCameraTask(task):
    angleDegrees = task.time * 20.0
    angleRadians = angleDegrees * (math.pi / 180.0) * math.sin(angleRadians), -20.0 * math.cos(angleRadians), 3), 0, 0)
    return Task.cont

taskMgr.add(SpinCameraTask, "SpinCameraTask")


And that’s my output:

Why teapot isn’t textured like the sphere below? Where’s my mistake?

hi, welcome to panda.
hm. just a wild guess. but i think the teapot has not UV-map by default. so, the texture itself would never be mapped onto it correctly. so it’s not your mistake.

Thank you! :smiley:

What should I do then?
I’ve read about some problems with TexGen and auto-shader. I experienced it by myself already: “Shader Generator does not support TexMatrix yet” or sth like that.
Is there a better solution that using TexGen?

Well, you could use a model that actually has UV’s on it (or create one that does). Most models do have UV’s; the teapot is an exception.


Thanks for advice.
And thanks for replies to both of you. I’m going back to work. :smiley:

For the record, the latest CVS version of Panda supports this - you can expect that to work in 1.7.0.

Great to hear that. :smiley:

ps. To the previous reply by drwr: your advice did it’s best. Works great. Thanks a lot.