WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How to simply texture an avatar's head with a jpeg graphic? (https://forum.worldviz.com/showthread.php?t=232)

vr_boyko 10-22-2004 11:50 AM

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!

farshizzo 10-22-2004 11:59 AM

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')

Did swapping the vzf heads not work either?

vr_boyko 10-25-2004 07:22 PM

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?

farshizzo 10-26-2004 10:44 AM

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)



All times are GMT -7. The time now is 04:15 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC