#1
|
|||
|
|||
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()
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab This time, it should work... |
Thread Tools | |
Display Modes | Rate This Thread |
|
|