View Single Post
  #1  
Old 04-02-2013, 05: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:	1617
Size:	13.9 KB
ID:	586   Click image for larger version

Name:	Arrow, Screen Shot, Annotated.png
Views:	1649
Size:	53.6 KB
ID:	588  
Reply With Quote