How to determine current scale factor?

I surely have a defect in my program, because things are displaying at the wrong scale. It would be helpful if I could get the scale factors from the currently active matrix. That would help me track the problem down.

How can I best access scale factors?

Thanks!

Does this program help you figure it out?

import org.openrndr.application
import kotlin.system.exitProcess

fun main() = application {
    program {
        fun itsMoreFunToCompute() {
            println("\nview")
            println(drawer.view)
            println("\nprojection")
            println(drawer.projection)
            println("\nmodel")
            println(drawer.model)

            println("\n-> do scale(2.0)")
            drawer.scale(2.0)
        }
        extend {
            itsMoreFunToCompute()
            itsMoreFunToCompute()
            itsMoreFunToCompute()
            exitProcess(0)
        }
    }
}
1 Like

Thanks, but no. I know how to set scale. I’m looking for a way to read out the value to which it already set. Thanks,

R

Did you study the output in the console? I thought the drawer.model matrix might contain what you’re looking for (x, y and z scales), as explained here under the scaling section.

1 Like

My bad! I did not. Yes, that helps, thanks for sticking with me!

R

2 Likes

Great link, too! I had not found that. I know the general graphics stuff, but that’s a useful write up! Thanks again!

R

2 Likes