WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-02-2014, 04:01 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
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?
Reply With Quote
  #2  
Old 01-02-2014, 05:06 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
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)
So my question is whether & how I can prevent Vizard from scaling the image worldvizlogo-white.jpg from (1280, 1024) to (1024, 1024).
Reply With Quote
  #3  
Old 01-02-2014, 08:42 AM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
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.
Reply With Quote
  #4  
Old 01-13-2014, 08:48 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
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!
Reply With Quote
Reply

Tags
aspect ratio, scaling, texture

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 11:48 AM.


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