WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Adding Images to Objects (https://forum.worldviz.com/showthread.php?t=5403)

gerardo697 07-14-2015 01:11 PM

Adding Images to Objects
 
I was wondering if there is a better approach when trying to add an image onto a wall. I have created the following quadrilateral, and when I run the program it just shows a brown square. How can I fix this?

import viz
viz.setMultiSample(8)
viz.fov(60)
viz.go()

viz.startLayer(viz.QUADS)
viz.vertex(0,0,15)
viz.vertex(10,0,15)
viz.vertex(10,10,15)
viz.vertex(0,10,15)
myQuad = viz.endLayer()
texture = viz.add( 'duck.jpg' )
myQuad.texture( texture)

gerardo697 07-17-2015 06:27 AM

One way to do this
 
I found out that the following works with any kind of picture extension.

pic = viz.addTexture( '20150716_113030.jpg' )
quad = viz.addTexQuad()
quad.setPosition([x,z,y])
quad.setSize([width,height])
quad.setEuler([270,0,0])
quad.texture(pic)


The setEuler() part is if you want to turn the picture around.


All times are GMT -7. The time now is 01:03 AM.

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