WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   2D Entities in Vizard (https://forum.worldviz.com/showthread.php?t=1875)

andguent 03-02-2009 07:41 AM

2D Entities in Vizard
 
Hey there,

I have troubles getting 2d image stuff working in vizard. I know it's a trivial thing to do and maybe it's just me :rolleyes:

From my OpenGL background I normally would proceed by calling glOrtho to setup the projection matrix and then dump some GL_QUADS ...but somehow I was yet unable to do so in vizard.

Would it be possible to point me to a short snippet how i can do it with some foo.png?

Thanks in advance,
André

farshizzo 03-02-2009 09:30 AM

Here is code that will display an image in the lower left corner of the screen. Let me know if anything is unclear.
Code:

import viz
viz.go()

# Create texture from image file
image = viz.add('ball.jpg')

# Display image in lower left corner of screen
quad = viz.addTexQuad(parent=viz.ORTHO)
quad.alignment(viz.ALIGN_LEFT_BOTTOM)
quad.texture(image)
quad.setScale(image.getSize())



All times are GMT -7. The time now is 05:39 AM.

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