Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
Rotate Current View 2D about Screen Z (Ruby solution)
-
Okay I think I can attempt my first Ruby plugin with a little help.
I'm thinking that if I can get two points selected on screen and get the vector between them I can adjust my code below to rotate the SU view to a rotation about screen z.
Can someone give me a hand?
` model = Sketchup.active_model
view = model.active_viewNab existing eye and target objects
eye = view.camera.eye
target = view.camera.targetDefine a new camera object
newCamera = Sketchup::Camera.new
up = newCamera.up
Redfine Up vector, ignoring z (Last array element)
This should rotate the view about the screen center
Values should range from -1.0 tp 1.0 each I would imagine
up[0] = 1.0
up[1] = 1.0
up[2] = 0.0Set new camera components
newCamera.set eye, target, up
Apply new view
status = view.camera=newCamera`
Advertisement