Control over camera lens shift ?
-
Oh @kioobee: If you are on Windows, you can use a built-in Camera Properties test dialog...
at the console:
Sketchup.send_action(10624)
or to add it to the "Camera" menu:
m = UI.menu('Camera');m.add_item(('Camera Properties...')) {Sketchup.send_action(10624)}
-
So kioobee: How would like a camera shift tool to work ??
My guess would be click the tool button, then
The current camera target is indicated, and a vector attached to the mouse allows the user to indicate shift at target and direction in one click.
The target is shifted, and the camera is shifted in proportion.
Is there any standard symbol for a lens shift ??
EDIT: Actually it seems that the "Pan" (aka "Dolly") tool already does this.
-
@dan rathbun said:
EDIT: Actually it seems that the "Pan" (aka "Dolly") tool already does this.
Dan, lens shifting is correcting perspective - often done when photographing architectural images to keep vertical lines parallel. Also called keystone correction.
-
-
@tig said:
You can post-process images to have parallel verticals with ShiftN... http://www.marcus-hebel.de/
He's looking for a Ruby API method though. Within SketchUp "Camera -> Two-Point Perspective" will create the desired effect - but the Ruby API does not allow you to get/set this property.
-
You could use perspective OFF mode for the camera AND transform-rotate the whole model about its origin, so that the camera's view direction is square on to a selected face. Like 'align view to face', but with the model moving rather than the camera!
Of course this would be messy and can't apply to just one Scene tab, as the entire model is thereafter foobarred.
However, if you want to export just an image in code... then model.start_operation('!'), save the camera's details, set perspective OFF for the camera, do the model transformation-rotation relative to a [pre]selected face/point, perhaps zoom extents of zoom-selected ?, export the current view's image and then use model.abort_operation to reset the model back to how it was, and also change the camera back to what it was too as the abort won't encompass that...What exactly are you trying to achieve 'in code' here ??
-
@thomthom said:
He's looking for a Ruby API method though. Within SketchUp "Camera -> Two-Point Perspective" will create the desired effect - but the Ruby API does not allow you to get/set this property.
Windows only:
Sketchup.send_action(10627)
-
@dan rathbun said:
@thomthom said:
He's looking for a Ruby API method though. Within SketchUp "Camera -> Two-Point Perspective" will create the desired effect - but the Ruby API does not allow you to get/set this property.
Windows only:
Sketchup.send_action(10627)
And if the camera is already in 2pt mode then this will toggle it of. ... wonder if toggling perspective on/off wil reset a 2pt perspective. But then again the problem is that it's Win only.
-
@thomthom said:
And if the camera is already in 2pt mode then this will toggle it off. ... wonder if toggling perspective on/off wil reset a 2pt perspective. But then again the problem is that it's Win only.
Nope.. toggles between Parallel Projection and normal Perspective.
The easiest thing to do is setup a template with at least 2 Scene pages.
Set one to Perspective... and Update the scene.Set the another to 2Pt Perspective (I named this one "Keystone Correction",) and update the scene.
Then turn Scene Tabs ON, and switch between them, as desired.
Sample:
shift.skp -
Wow, i can't believe how reactive you guys are ! Thanks so much for your feedback.
It looks like the Two Point Perspective is the tool i need, thanks for poiting it out.
Although it could be triggered by the send_action command, to control it precisely in ruby afterwards is still problematic : how can i control the amount of shift to apply in ruby ?
The reason i want to do it ? I'm developping a video projector simulator plugin, and i would like the user to be able to 'see' from the projector perspective.
On the image below, i put an image of a projector with a vertical lens shift of 100%. You can see what the projection cone looks like, it is off centered, and i would need to place a camera, and apply two point perspective to match the projection of the video projector.
I hope this clarifies what i want to achieve
-
Unfortunately there is no control over the amount of lens shift in SketchUp.
There is currently just 2pt perspective - as mentioned, not even that can be controlled reliably.
Advertisement