![]() |
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) |
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 |
All times are GMT -7. The time now is 07:36 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC