|
#1
|
|||
|
|||
Vizard automatically scaling image to an aspect ratio of 1:1
I want to present pictures with an aspect ratio different from 1:1 (meaning a square picture) as textures in Vizard. When I apply a texture to a surface with the same aspect ratio as the picture, Vizard still scales the image to a 1:1 aspect ratio. Because I'm working with a lot of pictures, the scaling of all the images takes time that I want to decrease. Is there any way to apply pictures without Vizard scaling them to an aspect ratio of 1:1?
|
#2
|
|||
|
|||
And here some code showing the 'problem':
Code:
import viz viz.go() viz.eyeheight(0) box = viz.add('box.wrl') box.setScale(1.5,1,0.001) box.setPosition(0,0,1.5) box.color(1,1,1) tex = viz.addTexture('worldviz-logo-white.jpg') box.texture(tex) |
#3
|
|||
|
|||
OpenGL limits the texture resolution to always be a power of two (i.e. 16, 32, 64, 128, etc.). However this is not restricted to aspect ratio, so you can have 512x256 rectangular textures as well.
Actually I read that in newer versions of OpenGL, non power of two (NPOT) textures are supported, but I know too little about that to come up with a possible solution for you. My solution would be to find a Photoshop script that automatically places and fits every image in a 1024x1024 texture, and then edit the texture coordinates in Vizard to get the result you want. |
#4
|
|||
|
|||
Hi Erikvdb,
Thanks for your suggestion! I did not manage to get Vizard working with non power of two textures, and I did not find/create a photoshop script to solve the issue like that. Ultimately, I just let Vizard load the program for 10 seconds. No big deal at the moment. If someone has a simple solution, then I'm all eyes/ears! |
Tags |
aspect ratio, scaling, texture |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Vizard 4 Beta Testing | farshizzo | Announcements | 0 | 02-01-2011 11:46 AM |
Vizard 4 Beta Testing | farshizzo | Vizard | 0 | 02-01-2011 11:46 AM |
Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 12:13 PM |
vizard quit automatically in full screen stereo mode | fuyonggang | Vizard | 3 | 09-15-2008 10:51 AM |
Scaling and Rotating in Vizard | Vinicius Lima | Vizard | 1 | 07-25-2007 10:20 AM |