Back to Filament

setScaling

docs/android/dokka/filament-android/com.google.android.filament/-camera/set-scaling.md

1.75.02.3 KB
Original Source

//filament-android/com.google.android.filament/Camera/setScaling

setScaling

[main]
open fun setScaling(xscaling: Double, yscaling: Double)

Sets an additional matrix that scales the projection matrix.

This is useful to adjust the aspect ratio of the camera independent from its projection. First, pass an aspect of 1.0 to setProjection. Then set the scaling with the desired aspect ratio:` double aspect = width / height;

 // with Fov.HORIZONTAL passed to setProjection: 
 camera.setScaling(1.0, aspect); 
 
 // with Fov.VERTICAL passed to setProjection: 
 camera.setScaling(1.0 / aspect, 1.0); 
 ` By default, this is an identity matrix. 

Parameters

main

xscalinghorizontal scaling to be applied after the projection matrix.
yscalingvertical scaling to be applied after the projection matrix.

See also

com.google.android.filament.Camera

[main]
open fun setScaling(inScaling: Array<Double>)


Deprecated


Sets an additional matrix that scales the projection matrix.

This is useful to adjust the aspect ratio of the camera independent from its projection. First, pass an aspect of 1.0 to setProjection. Then set the scaling with the desired aspect ratio:` double aspect = width / height;

 // with Fov.HORIZONTAL passed to setProjection: 
 double[] s = {1.0, aspect, 1.0, 1.0}; 
 camera.setScaling(s); 
 
 // with Fov.VERTICAL passed to setProjection: 
 double[] s = {1.0 / aspect, 1.0, 1.0, 1.0}; 
 camera.setScaling(s); 
 ` By default, this is an identity matrix. 

Deprecated

use setScaling

Parameters

main

inScalingdiagonal of the scaling matrix to be applied after the projection matrix.

See also

com.google.android.filament.Camera