# How to scale a rendering scene in vtk.js ?

**URL:** https://discourse.vtk.org/t/how-to-scale-a-rendering-scene-in-vtk-js/7604
**Category:** Web
**Created:** [January 8, 2022, 8:52pm UTC](https://discourse.vtk.org/t/how-to-scale-a-rendering-scene-in-vtk-js/7604 "2022-01-08T20:52:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![j-fu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/j-fu/32/3977_2.png) [@j-fu](https://discourse.vtk.org/u/j-fu)
#### Post date: [January 8, 2022, 8:52pm UTC](https://discourse.vtk.org/t/how-to-scale-a-rendering-scene-in-vtk-js/7604/1 "2022-01-08T20:52:23Z")

</div>

Hi, I would like to achieve something like in [Scaling a rendering scene](https://discourse.vtk.org/t/scaling-a-rendering-scene/173)  
with vtk.js. There seems to be no `cam.SetModelTransformMatrix()` equivalent in vtk.js at the moment. Are there any recipes/workarounds?

---

<div class="post-metadata">

### Author: ![ken-martin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ken-martin/32/884_2.png) [@ken-martin](https://discourse.vtk.org/u/ken-martin)
#### Post date: [January 10, 2022, 3:14pm UTC](https://discourse.vtk.org/t/how-to-scale-a-rendering-scene-in-vtk-js/7604/2 "2022-01-10T15:14:00Z")

</div>

I believe you can scale each actor as desired. The camera approach is just a simplification of that (although one that can create issues as you see in that thread)

---

<div class="post-metadata">

### Author: ![j-fu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/j-fu/32/3977_2.png) [@j-fu](https://discourse.vtk.org/u/j-fu)
#### Post date: [January 10, 2022, 3:56pm UTC](https://discourse.vtk.org/t/how-to-scale-a-rendering-scene-in-vtk-js/7604/3 "2022-01-10T15:56:08Z")

</div>

Thanks! `vtkActor.setScale()` indeed is a simpler approach to scale the data, so thanks for the hint!  
But in this case something like `cubeAxesActor.setXAxisRange()` would come in handy in order to allow to scale the label values independent of the actor.

Basically I need to be able to apply an `aspect` factor in order to visualize data with large aspect ratios, as e.g. in [matplotlib](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_aspect.html).

For the time being, as a workaround I can use the `setScale()` method and write the factor into the axis label text.
