WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-02-2013, 06:26 PM
javadi javadi is offline
Member
 
Join Date: Mar 2013
Location: London
Posts: 33
Screen Size and Scaling

Hi,

I have two questions regarding screen size and scaling of objects. Here I have attached two images (one original texture and one screen shot of the texture placed in two orientations). I have also annotated the screen shot for clarification. I have two issues,
  1. In order to achieve an equal width of arrows (green lines in the screen shot), I have to adjust the window size to something like [760, 600]. How can I calculate these values? Further information regarding the size of the original texture and my display setting is gone in the bottom.
  2. My other issue is the ratio of width to height of the texture (green to blue lines in the screen shot). The original texture looks much slimmer than the ones displayed. I use 'setScale' method to adjust the x and y scales differently (the blue line in the code below). When we add the texture, we specify a size. For that, I use one number, which I assume it defines a square. How can I merge this scaling in the line in blue with texture size in the line in red?
Some information on the original texture and my display settings,
  • The original image: 600 x 780 pixels, 72 x 72 pixels per inch resolution
  • The display: 1920 x 1200 LCD monitor.
The code that I used to create display the arrows:
Code:
import viz

viz.window.setSize([760, 600])

viz.go()

TextureArrow = viz.addTexture('Bank, Task\Arrow, Original.png')

DispArrow1 = viz.addTexQuad(viz.SCREEN, viz.MainScene, 500)
DispArrow1.setScale([600.0 / 780, 780.0 / 780, 1])
DispArrow1.setPosition([0.7, 0.7, 0])
DispArrow1.setEuler([0, 0, 90], mode = viz.ABSOLUTE)
DispArrow1.texture(TextureArrow)

DispArrow2 = viz.addTexQuad(viz.SCREEN, viz.MainScene, 500)
DispArrow2.setScale([600.0 / 780, 780.0 / 780, 1])
DispArrow2.setPosition([0.5, 0.3, 0])
DispArrow2.setEuler([0, 0, 0], mode = viz.ABSOLUTE)
DispArrow2.texture(TextureArrow)
Very many thanks for your attention.

Greetings,
Attached Thumbnails
Click image for larger version

Name:	Arrow, Original.png
Views:	2834
Size:	13.9 KB
ID:	586   Click image for larger version

Name:	Arrow, Screen Shot, Annotated.png
Views:	2923
Size:	53.6 KB
ID:	588  
Reply With Quote
  #2  
Old 04-02-2013, 06:38 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I would recommend adding the arrow to the viz.ORTHO layer, instead of viz.SCREEN. The SCREEN layer works in normalized (0-1) units, which is what causes the aspect ratio distortions. The ORTHO layer works in pixel units, which preserves the objects aspect ratio.
Reply With Quote
  #3  
Old 04-02-2013, 06:56 PM
javadi javadi is offline
Member
 
Join Date: Mar 2013
Location: London
Posts: 33
Quote:
Originally Posted by farshizzo View Post
I would recommend adding the arrow to the viz.ORTHO layer, instead of viz.SCREEN. The SCREEN layer works in normalized (0-1) units, which is what causes the aspect ratio distortions. The ORTHO layer works in pixel units, which preserves the objects aspect ratio.
Thanks for your prompt reply. It works. I only need to resize everything proportional to the size of the window, which should be fine.

Cheers
Reply With Quote
Reply


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
Scaling Portions of a CAL3D Model shivanangel Vizard 2 07-26-2012 01:17 AM
automatic scaling rlh001 Vizard 5 06-18-2012 10:31 AM


All times are GMT -7. The time now is 12:49 PM.


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