#1
|
|||
|
|||
How to simply texture an avatar's head with a jpeg graphic?
Hi there,
So in regards to a previous post, we tried adding a "happy" or "angry" head as a morph target to the "neutral" head to no avail -- so we've come up with a 'hackish' solution. We're taking the neutral texture graphic that's already applied to the neutral .vzf head....and then we're changing minor things around within that texture graphic, and we want to paste that texture onto the current .vzf head. What's the code to simply overwrite the current texture graphic on the current .vzf head (without swapping .vzf files)? Thanks! |
#2
|
|||
|
|||
Hi,
Just add the texture and apply it to the head: Code:
neutral = viz.add('neutral.jpg') happy = viz.add('happy.jpg') head = viz.add('head.vzf') head.texture(happy,'name of the geom you want to apply graphic to') . . . head.texture(neutral,'name of the geom you want to apply graphic to') |
#3
|
|||
|
|||
When I did what you suggested (adding a new function to my person class to texture the head with jpegs)
def changehead(self, texture): newtexture = viz.add(texture) self.head.texture(newtexture, 'geom_0') And I called the function using some arbitrary key: person1.changehead('disgust.jpg') The head in the world turns black...the texture doesn't look like it's been applied to the head...am I doing something wrong? |
#4
|
|||
|
|||
Hi,
I believe your head model is using repeating texture coordinates, so you'll probably need to set the texture to repeat mode also. After you add the texture try the following: Code:
newtexture.wrap(viz.WRAP_S,viz.REPEAT) newtexture.wrap(viz.WRAP_T,viz.REPEAT) |
|
|