WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Matrix Transform and Bumpmap (https://forum.worldviz.com/showthread.php?t=2410)

GiudiceLab 11-27-2009 12:42 PM

Matrix Transform and Bumpmap
 
We are attempting to add a field of grass by applying a texture to a texquad. We are scaling the texquad using a matrix transform, applying the grass texture and then applying a bumpmap. The (diffuse) texture seems to repeat fine and looks good without the (normal) bumpmap, but when we add the bumpmap, it looks like it doesn't scale the same way as the first texture. If we apply the diffuse and normal layers without scaling, it seems to work fine, except of course, it's not really field-sized.

How can we apply the bumpmap so that it scales with the diffuse texture?

Here's our code:
Code:

# add the ground
meadow = viz.addTexQuad()
meadow.setEuler([0,90,0])
meadow.setScale([100,100,1])
matrix = vizmat.Transform()
matrix.setScale([25,25,1])

grass = viz.addTexture('GrassSample.jpg')
grass.wrap(viz.WRAP_S,viz.REPEAT)
grass.wrap(viz.WRAP_T,viz.REPEAT)
meadow.texmat(matrix,'',1)
meadow.texture(grass,'',1)

grass_bump = viz.addTexture('GrassSampleBump.jpg')
grass_bump.wrap(viz.WRAP_S,viz.REPEAT)
grass_bump.wrap(viz.WRAP_T,viz.REPEAT)
meadow.texmat(matrix,'',0)
meadow.bumpmap(grass_bump,'',0)

light = viz.add(viz.LIGHT)
light.position(-1,0.7,0.5,0)
light.enable()
viz.get(viz.HEAD_LIGHT).disable()

If you need the images, we can send them to you (they're too large to upload). Thanks!


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

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