WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-05-2008, 04:09 PM
vDeonne vDeonne is offline
Member
 
Join Date: Sep 2008
Posts: 1
how to tile a texture

I tried to tile the 'ground' by texturing using the code below. Rather than tile, however, the texture image is enlarged to texture the ground -- with no repeat. What code can I use to ensure that the texture image tiles rather than stretches?

ground = viz.add('tut_ground.wrl')
ground.setPosition(0,0,0)
ground.collidePlane()
leaves = viz.add('fall-leaves.jpg')
leaves.wrap(viz.WRAP_S,viz.REPEAT)
leaves.wrap(viz.WRAP_T,viz.REPEAT)
ground.texture(leaves)
Reply With Quote
  #2  
Old 11-05-2008, 05:35 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You need to apply a texture matrix to the ground model to scale the texture coordinates up. Here is some sample code:
Code:
#Number of times to repeat texture horizontally/vertically
NUMBER_OF_REPEATS = 10

leaves = viz.add('fall-leaves.jpg',wrap=viz.REPEAT)

ground = viz.add('tut_ground.wrl')
ground.setPosition(0,0,0)
ground.collidePlane()
ground.texture(leaves)

#Apply a texture matrix that scales to number of repeats
ground.texmat( viz.Matrix.scale(NUMBER_OF_REPEATS,NUMBER_OF_REPEATS,1) )
Reply With Quote
Reply


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
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
3D Texture Mapping in Vizard? stefs Vizard 2 03-25-2008 03:34 AM
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 05:39 PM.


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