I have data to make a line graph and I’d like the graph to scale proportionately to the size of the render window.
I’m getting stuck on determining the scaling factor for the Camera COMP
For example the project I’ve linked below just has a button to pulse a value of 1 that is then converted into a SOP and rendered out. pulse help.toe (46.2 KB)
I would like to mathematically determine how much I need to scale the Y axis of the camera (Xform) so that the pulse of 1 reaches the top of the window (which is 720px high).
If I manually change the Camera y-axis scale to ~0.089, it’ll hit the top of the window. But I’m getting stuck on determining what the actually scaling factor is so that if I were to change the y size of the render output the graph would still hit the top of the screen.
For example if I change render1 TOP to have a resolution of 1280x1000 it appears the camera y-axis scale needs to be .064 for the pulse to hit the top. So if I’m correct, it seems to be a non-linear relationship?
since you are using an orthographic camera, you can take into account the aspect ratio of your render. So it is something like: orthoWidth/(renderWidth/renderHeight)
You could use this directly on the “geo1” Geometry component. If you would like to use this on the Camera COMP, as the scale there works inverse, a formula would be (renderWidth/renderHeight)/orthoWidth
Unrelated but a nice little simplification of your network: The Pattern CHOP can use an input from which it will retrieve it’s length - no reference necessary. With this then, you can set the Type parameter to “Ramp Samples” and with all the other parameters default, set the Amplitude parameter to 1/me.time.rate resulting in the 20 that can be used as width.
Since we now see that there is a relationship of the Orthowidth and the Aspect Ratio to the necessary height of the pulse, we can simplify further:
set the orthowidth parameter of the camera to “1”
set the scale y parameter of the camera to renderWidth/renderHeight - simplification from ortholength being 1
set the Pattern CHOP’s Type parameter to “1” and the Amplitude parameter to “1”