Hi Vizard Support people,
I had a question when it can to implement normal mapping on objects inside of Vizard.
I found a few questions already about this and I found that the simple:
object.bumpmap(bumpmapfile)
worked fine the first time I used it on a simple .obj model with a normal map
produced from a software package called Z Brush as you can see below with the code:
Code:
import viz
viz.go()
viz.MainView.setPosition([0,0,-10])
test = viz.add('prototypeSphere.obj')
normal = viz.add('prototypeSphere4.BMP')
test.bumpmap(normal)
head = viz.MainView.getHeadLight()
head.disable()
l = viz.addLight()
l.setPosition([20,20,0])
def onUpdate(e):
#This will be called every frame
test.setEuler([1,0,0], viz.RELATIVE)
viz.callback(viz.UPDATE_EVENT,onUpdate)
In that demo the sphere would turn around and we'd get to see all the lovely detail added by the normal map as shown below:
The problem I am having now is when I am trying to apply a normal map to a model in a CFG file (Cal 3D format for animation).
Code:
import viz
viz.go()
viz.MainView.setPosition([0,0,-10])
TRex = viz.add("TRex.CFG")
normal = viz.add("TRexNormalMap_03_Tangent.BMP")
head = viz.MainView.getHeadLight()
head.disable()
TRex.bumpmap(normal)
Same code as before with same process for creating a normal map in Z Brush but I get broken results. The model reacts to lighting but only once and it seems to be stuck at some side lighting phase. Regardless of additional lights being added the model is stuck in this kind of lighting.
Any help? Is it not possible to add normal mapping to non-static objects?
Here is my normal map for the T-Rex, but I'm sure that is correct:
I used Tangential instead of Adaptive when generating it, which seemed
to make sense since I believe Vizard needed the tangential information when
calculating the normal map in the pixel shader. And it worked for the sphere.
http://i200.photobucket.com/albums/a...03_Tangent.jpg
Thanks,
George