WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 04-25-2008, 10:03 AM
aznan aznan is offline
Join Date: Apr 2008
Posts: 11
Same texture, but different..

I want to have a model with one texture that can be swapped with another using model.texture("new_tex.jpg"). When swapping back I noticed that the new "first" texture was much darker than the original.

I have attached a scene with two cubes which demonstrates the problem.

What is happening?
Attached Files
File Type: zip (2.0 KB, 465 views)
Reply With Quote
Old 04-28-2008, 10:39 AM
aznan aznan is offline
Join Date: Apr 2008
Posts: 11
I tried adding a cube without any textures, thinking maybe the original texture blended with the new original, but then it turned completely black. I also tried playing around with model.appearance() and texblend, but to no avail.

Doesn't anyone have a clue as to what is going on?
Reply With Quote
Old 04-28-2008, 10:51 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
The cube uses negative values for the texture coordinates. This means you need to enable wrapping on the texture. Try using the following code when adding the texture:
tex = viz.addTexture("red2.gif",wrap=viz.REPEAT)
Vizards default wrap mode is viz.CLAMP_TO_EDGE, which does not allow for texture coordinates outside the range of [0,1].
Reply With Quote
Old 04-29-2008, 02:29 AM
aznan aznan is offline
Join Date: Apr 2008
Posts: 11
Yup, that was it. Thanks a bunch!
Reply With Quote

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
3D Texture Mapping in Vizard? stefs Vizard 2 03-25-2008 03:34 AM
missing parts of head texture sjp Vizard 4 10-10-2006 01:10 PM
how I can get my texture to appear exactly as is defined mspusch Vizard 1 04-23-2005 12:12 PM
avatar head texture issues rconrey Vizard 3 11-17-2004 04:05 PM
How to simply texture an avatar's head with a jpeg graphic? vr_boyko Vizard 3 10-26-2004 10:44 AM

All times are GMT -7. The time now is 10:05 PM.

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