Workspace and Modeler camera not matching

Technical questions, etc..
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Workspace and Modeler camera not matching

Post by trueBlue »

clintonman wrote: 12 Dec 2022, 19:15 Here's the trick. Modelspace horizontal FOV is controlled by the Z size value which is the zoom. This has to be converted to a FOV value with some math. Set the FOV on the camera from the script then go inside the camera and set HorizontalFOV on/true/checked on the Camera node.
Nice
I think you mean hook it up to the Camera node?
Here is a tS7.6 Camera1 with it hooked up and the HorizontalFOV exported to the top panel
Camera1.png
Camera1.png (5.66 KiB) Viewed 851 times
Removed due to update
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Workspace and Modeler camera not matching

Post by clintonman »

trueBlue wrote: 12 Dec 2022, 19:58
clintonman wrote: 12 Dec 2022, 19:15 Here's the trick. Modelspace horizontal FOV is controlled by the Z size value which is the zoom. This has to be converted to a FOV value with some math. Set the FOV on the camera from the script then go inside the camera and set HorizontalFOV on/true/checked on the Camera node.
Nice
I think you mean hook it up to the Camera node?
...
No, you have to type in the value for the camera z size to get the fov value.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Workspace and Modeler camera not matching

Post by trueBlue »

clintonman wrote: 12 Dec 2022, 20:19
trueBlue wrote: 12 Dec 2022, 19:58
clintonman wrote: 12 Dec 2022, 19:15 Here's the trick. Modelspace horizontal FOV is controlled by the Z size value which is the zoom. This has to be converted to a FOV value with some math. Set the FOV on the camera from the script then go inside the camera and set HorizontalFOV on/true/checked on the Camera node.
Nice
I think you mean hook it up to the Camera node?
...
No, you have to type in the value for the camera z size to get the fov value.
I hooked up the FOV to your script and the output to the Camera node
Isn’t that the same thing?
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Workspace and Modeler camera not matching

Post by clintonman »

trueBlue wrote: 12 Dec 2022, 21:21
clintonman wrote: 12 Dec 2022, 20:19
trueBlue wrote: 12 Dec 2022, 19:58
Nice
I think you mean hook it up to the Camera node?
...
No, you have to type in the value for the camera z size to get the fov value.
I hooked up the FOV to your script and the output to the Camera node
Isn’t that the same thing?
CameraZoom.jpg
Z Size value from model space is the Zoom value
It is needed to calculate the FOV value for workspace
Hooking up Camera_Z_Size and calling it FOV isn't what's happening.

ZoomAndFOV.jpg
2 identical cameras one has zoom connected to FOV, one is just ordinary FOV, both show the same FOV value. Same FOV should look the same.

You asked if I meant to hook it up and the answer is no, I meant to just type a value in and get a value out. There's nothing to stop hooking it up, but I would make a command script instead that just sets the FOV value when needed.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Workspace and Modeler camera not matching

Post by trueBlue »

Okay, I see
Here is a new tS7.6 version that uses a jScript command
Camera1.png
Camera1.png (6.71 KiB) Viewed 856 times
.
The Set button runs your script and sets the Camera's FOV from your script's results (FOV out)
Then you check the HorizontalFOV

But when I Set it using the Camera's Z Size, Model's Camera's Z Size changes to a different value
Have not tried rendering anything yet but visually the Model view and the Workspace view seems simi different
The window(s) behaviors seem to be working

Anyway, only wanted to create a tS7.6 version because your original script crashes tS7.6
Attachments
Camera1.RsObj
(32.47 KiB) Downloaded 58 times
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Workspace and Modeler camera not matching

Post by clintonman »

trueBlue wrote: 13 Dec 2022, 00:00 ...
.
The Set button runs your script and sets the Camera's FOV from your script's results (FOV out)
Then you check the HorizontalFOV

But when I Set it using the Camera's Z Size, Model's Camera's Z Size changes to a different value
...
Oh, maybe it doesn't work well with the synchronize script.

trueBlue wrote: 13 Dec 2022, 00:00 ...

Anyway, only wanted to create a tS7.6 version because your original script crashes tS7.6
:o Do all tS7.61 scripts crash tS7.6 ?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Workspace and Modeler camera not matching

Post by trueBlue »

No synchronize scripts in tS7.6, synchronization works in tS7.6
tS7.61 objects are not backwards compatible
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Workspace and Modeler camera not matching

Post by clintonman »

I did some more tests. Didn't notice before that changes in workspace or model will update the other side.
It looks like the script needs to be run with the bridge off, otherwise the bridge just sends bad values across. Which it will do again when it is turned back on.
Another option would be to remove the FOV connection from the camera.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Workspace and Modeler camera not matching

Post by clintonman »

trueBlue wrote: 13 Dec 2022, 00:30 No synchronize scripts in tS7.6, synchronization works in tS7.6
tS7.61 objects are not backwards compatible
Did some tests with empty scripts from 7.61 in 7.6.
Load jScript command does nothing
Load jScript object gives an error
Load jScript Function Set came in without any errors
I added some code to the jScript Function Set and it still loaded just fine.

I think the jScript object runs itself, so if it's not empty it will crash trueSpace 7.6

So it looks like only the jScript object from 7.61 will make 7.6 crash.

Technical note: The jScript object works poorly as a simple calculator in 7.6 unless the input is set to "Update on Change"
Clinton Reese

http://clintons3d.com
User avatar
Emmanuel
Chief Warrant Officer
Posts: 651
Joined: 14 Jun 2009, 06:47

Re: Workspace and Modeler camera not matching

Post by Emmanuel »

Many thanks, both of you.

Your tool Clinton does the job : Adjusting the WS FOV once for all to match the same frame is the trick. Too bad it is not stored with the scn file (I can store the right FOV setting along with an Object Note attaached to the Modeler camera though).

I wonder if we could make a special Modeler camera that sends a different Z value to the Bridge. This would do the trick from the other way : adjust the frame from Modeler side and leave the Workspace camera unchanged.

Perhaps, a tsX could handle such thing. It would handle two versions of the camera : one that displays in Modeler, and an other one (with adjustable Z value) that will send its values to the Bridge...
Post Reply