View Single Post
  #3  
Old 02-08-2016, 03:21 AM
rawphl rawphl is offline
Member
 
Join Date: Feb 2016
Posts: 2
I think I got this to work:

Code:
import viz
import vizcam
import vizshape
import vizfx

from vizfx.effect.material import BaseMaterial, Diffuse, Specular, Bump

viz.setMultiSample(8)
viz.fov(60)
viz.go()
viz.MainView.getHeadLight().remove()

pivot_nav = vizcam.PivotNavigate()
pivot_nav.rotateUp(60)
pivot_nav.setDistance(1)
viz.cam.setHandler(pivot_nav)

light1 = vizfx.addDirectionalLight(euler = (45, 45, 0))
vizfx.setAmbientColor([0, 0, 0])


box = vizfx.addChild('basketball.osgb')

diffuse_map = viz.addTexture("pattern_66_diffuse.png") 
diffuse_map.wrap(viz.WRAP_T, viz.REPEAT)
diffuse_map.wrap(viz.WRAP_S, viz.REPEAT)
normal_map = viz.addTexture("pattern_66_normal.png")
normal_map.wrap(viz.WRAP_T, viz.REPEAT)
normal_map.wrap(viz.WRAP_S, viz.REPEAT)
specular_map = viz.addTexture("pattern_66_specular.png")
specular_map.wrap(viz.WRAP_T, viz.REPEAT)
specular_map.wrap(viz.WRAP_S, viz.REPEAT)
material = vizfx.addMaterialEffect(
    Diffuse(diffuse_map, 0), Bump(normal_map, 1), Specular(specular_map, 2)
)
box.apply(material)
The textures are too big to upload to the forum, but the gist should be clear, see screenshot for the result.

I would still like to know if this is the intended way to do it
Attached Thumbnails
Click image for larger version

Name:	standard_textures.jpg
Views:	708
Size:	149.4 KB
ID:	759  
Reply With Quote