WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-27-2009, 01:42 PM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
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!
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
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


All times are GMT -7. The time now is 10:16 PM.


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