WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 01-27-2013, 06:28 PM
tokola tokola is offline
Join Date: Nov 2012
Posts: 67
Unhappy Texture map channel =! texture unit

Hi there,

I've been struggling for too long to make an effect using a turning belt (attached). I wanted to make the texture move along the T dimension but it happens on both sides of the belt which is not natural, since they should move in reverse to simulate a circular motion. So I split the belt in two element (in 3DS Max) and applied the same texture in different channels, but Vizard refuses to recognize the second channel no matter what! The code belt.getTexture('',1) returns always a blank node (-1).

What is the right way to do this in Max, so that it is recognized in Vizard? (I am using the .ive format with the OSG exporter). I noticed Max uses the "Map channel" which goes from 1 and on, but also has a "Material ID Number" going from #0 and on (right-clicking on a material in the material editor). Which one is the one corresponding to the "texture unit" in Vizard? I've made my multi-object material use both different UV maps in different channels but also different material IDs, with no result.

Attached Files
File Type: zip (83.2 KB, 315 views)
Reply With Quote
Old 01-29-2013, 10:29 AM
Veleno Veleno is offline
WorldViz Team Member
Join Date: Sep 2005
Posts: 148
Hi Tokola,

I'd recommend doing animated UVs in Max instead of doing them through code. It will be easier and give you more control.

First, make sure your exporter is up to date (and probably your copy of Vizard as well). Next, add a bitmap to a material. Under coordinates you can animate the following values:
  • Offset
  • Tiling
  • Angle
I've attached an image showing the rollout.

Also, some terminology:
  • Map channels split up a mesh into multiple sub-objects, each with it's own material, that behave as if they were a single object.
  • Texture units correlate to a series of textures contained within a single material (eg. diffuse + lightmap + reflection).
Attached Thumbnails
Click image for larger version

Name:	Animate UVs.jpg
Views:	330
Size:	31.6 KB
ID:	574  
Reply With Quote
Old 01-29-2013, 04:21 PM
tokola tokola is offline
Join Date: Nov 2012
Posts: 67
animating textures

Veleno, thanks for the response!

Although you did clear some things I still can't make Vizard recognize any other texture besides the one assigned in the diffuse port of the material (unit #0). I assigned the same material under Opacity for the second object of my multi-object material, but Vizard still returns viz.VizTexture(-1) when I try to get the texture in unit #1.

The reason I am insisting in making the animation in Vizard is that I want to have control over starting/stopping the animation and I don't know of any way to do this if using 3DMax texture animations. Plus, I have the impression that Vizard (or the OSG format) creates a mesh for every frame of an animation, which makes models really heavy (I don't know if this is the case for texture animations).

Overall, which one do you feel would be the best (more efficient) approach to simulating (and controlling) a turning belt? I also attach the .max file in case you feel like playing with it.

Thanks for your help,
Attached Files
File Type: zip (48.4 KB, 303 views)
Reply With Quote
Old 01-29-2013, 05:11 PM
tokola tokola is offline
Join Date: Nov 2012
Posts: 67
animating textures - addendum

This is an update of what HAS worked for me so far, although it seems counter intuitive. I had to split the object vertically in two sub-objects with names belt1 and belt2, and use the following code to simulate the stripes going up on one side (node) and down on the other side (node):
def TurnBelt():
		global matrix1, matrix2, belt
timer = vizact.ontimer(.01, TurnBelt)
Then, I am using timer.setEnabled(viz.TOGGLE) to enable/disable the belt motion, according to demands.
Although this works perfectly, I really don't know if it's the most efficient way, both CPU-wise, since I have lots of belts, but also as far as the work that is demanded in 3DSMax to format all belts appropriately (they are initially an extruded editable spline). If I could do everything with a single rotating UVMap/texture on a single object, I would be thrilled!

Thanks again for the assistance,
Reply With Quote
Old 02-05-2013, 11:17 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,465
You can control any type of imported OSG animation from Vizard. Only animations created with the OSG seguence helper store a mesh for each frame. See the following thread for some information on animation controls:

Add the following lines to the example script in that thread to toggle the water UV animation:
#toggle between pause/play
water_animation = animations.getChild('water')
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
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
Avatar texture swaping sleiN13 Vizard 5 06-24-2011 12:48 AM
How to apply shader and render texture to an object whj Vizard 0 04-23-2010 12:23 PM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
how I can get my texture to appear exactly as is defined mspusch Vizard 1 04-23-2005 12:12 PM

All times are GMT -7. The time now is 06:05 AM.

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