WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-22-2004, 12:50 PM
vr_boyko vr_boyko is offline
Member
 
Join Date: Sep 2004
Posts: 19
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!
Reply With Quote
  #2  
Old 10-22-2004, 12:59 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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?
Reply With Quote
  #3  
Old 10-25-2004, 08:22 PM
vr_boyko vr_boyko is offline
Member
 
Join Date: Sep 2004
Posts: 19
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?
Reply With Quote
  #4  
Old 10-26-2004, 11:44 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:52 AM.


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