WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Failed to load jpeg (https://forum.worldviz.com/showthread.php?t=4173)

mhead10 03-20-2012 06:52 AM

Failed to load jpeg
 
Hello,

I'm trying to simply import a .jpeg and then .wrl file from solidworks, however I've not been successful with either.

I saved an arbitrary jpeg (lake.jpeg) in the same folder as my python program (cube_test). I run the test script with the following code to import the picture:


import viz
viz.go()
background=viz.addChild('lake.jpeg')

I've also tried 'lake.jpg', as well as trying a .wrl file from solidworks. However, I alway get and error, like the following:

ERROR: Failed to load 'lake.jpeg'

Any thoughts on what I'm doing wrong?

Thanks ahead of time for any help!

Jeff 03-20-2012 07:20 AM

To load an image, use the viz.addTexture command instead of viz.addChild:
Code:

texture = viz.addTexture('lake.jpg')

mhead10 03-20-2012 11:53 AM

Thank you for your help! I knew it was something silly!


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

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