size distorsion on portrait mode
in
Programming Questions
•
2 years ago
I am starting a project that is going to be displayed on a 1080p fullHD display in vertical position (rotated 90º).
Since I don't have such a big display I've been testing scaling and rotating everything I draw so I can make an idea how is going to look like when is shown in the display.
The problem is that the graphics have different sizes when I display them in portrait or in landscape.
Here the size of the square is different:
To draw it in portrait or in landscape I just have to give the correct value to the portrait variable
here is code code:
I would like to be able to have the same size in both modes (portrait and landscape). I think it might have something to do with perspective.
thankyou
Since I don't have such a big display I've been testing scaling and rotating everything I draw so I can make an idea how is going to look like when is shown in the display.
The problem is that the graphics have different sizes when I display them in portrait or in landscape.
Here the size of the square is different:
To draw it in portrait or in landscape I just have to give the correct value to the portrait variable
here is code code:
- float scl;
boolean portrait=false;
void setup(){
angle=0;
scl=0.3;
if(portrait){
size(int(1080*scl),int(1920*scl),P3D);
}else{
size(int(1920*scl),int(1080*scl),P3D);
}
}
void draw(){
background(127);
scale(scl);
//in portrait mode I rotate the display
if(portrait){
translate(1080,0);
rotateZ(radians(90));
}
rectMode(CENTER);
translate(1920/2,1080/2,400);
rect(0,0,500,500);
}
I would like to be able to have the same size in both modes (portrait and landscape). I think it might have something to do with perspective.
thankyou
1