Camera: 360° rotation

Thank you @Wo3Dan I will try this. :slight_smile:

There is a thread about that here:

Another approach …

Hi everyone,

Here a new test this time with 36 faces and indeed like @Wo3Dan told the ‘jumping effect’ reduced when adding more camera points.

VIDEO3: 36 frames

1 Like

This was a video that I have put together using the same method.

As I kept consistent eye height, it is a smooth transition.

Just thought it might be relevant.

3 Likes

Thank you for sharing @josephkim626

I have a simple Ruby script that can be pasted into the Ruby console. It starts with whatever view you have and creates 360 scenes at 1 degree intervals around the origin. Works in either isometric or perspective views:

c = Sketchup.active_model.active_view.camera
p = Sketchup.active_model.pages
e = c.eye
r = Geom::Transformation.rotation([0,0,0],[0,0,1],Math::PI / 180.0)
for i in 0...360
  c.set(e,[0,0,0],[0,0,1])
  p.add("Scene " + (i+1).to_s)
  e.transform!(r)
end

Two examples:

9 Likes

sorry for my late reply @jimhami42. Thank you for sharing your ruby i looks great!

Just came across to this again, @jimhami42

jim, if I understand this script correct, is below correct for making scene every 2 degrees?

c = Sketchup.active_model.active_view.camera
p = Sketchup.active_model.pages
e = c.eye
r = Geom::Transformation.rotation([0,0,0],[0,0,1],Math::PI / 90.0)
for i in 0...180
  c.set(e,[0,0,0],[0,0,1])
  p.add("Scene " + (i+1).to_s)
  e.transform!(r)
end

I just divided 180 and 360 by 2. My math isn’t so good, nor my programming.

1 Like

Yes. This creates 180 scenes incrementally rotated PI / 90 radians (or 2 degrees). 360 degrees total.

1 Like

Hi there,

If I want to have the scenes zoomed out a bit, what part of the code would I need to change?

Thanks.

Nothing. The code uses the current eyepoint of the camera before the code runs. So just zoom out a bit before running the code.

A small point: you could replace the code:
Math::PI / 180.0

by
2.degrees

for greater clarity - and possibly slightly faster execution?

SU Ruby recognises .degrees and .radians methods to convert between radians (used internally) and degrees used more commonly by humans.

Oh right, silly me.

Thanks for that Dan.

A post was merged into an existing topic: Auto generated fly-through

Absolutely brilliant simple solution! Thanks!

I used this to create a super smooth video. I wanted a full rotation in 30 seconds at 60 frames per second, so 1,800 frames. I changed to code to rotate 0.2 degrees per iteration to get the 1,800 required scenes. It took a while to process, but it worked. Then I exported the animation as PNG files rather than creating a video. Then I imported into Premiere Pro CC as an image sequence, which assigns each numbered image to a single frame in order. The results were stellar!

2 Likes

Interesting. Would this work with Vray rendering?

I don’t see why not. However, I’m not a Vray expert. You end up with a number of images that each have to be rendered separately. I found this tutorial which uses only two scenes, but it explains the basics.

2 Likes

Thanks very useful.
Is there a way to limit the degrees so it doesn’t go around full 360deg on the object?
I tried changing the values and the only value I understand is the
for i in 0…360 = scene #

If it was possible to make it just go half circle on the object or even control it via number, that would be really helpful.

I added a simple menu to the code. You can specify the number of total scenes and the number of degrees you want to orbit.
jimhami42_orbiter.rbz (640 Bytes)

3 Likes

There’s a plugin that creates scenes automatically to create a 360 degree animation, if you want to reduce the angle you must delete or uncheck the include in animation the scene where you don’t want to be shown.
https://extensions.sketchup.com/extension/1b9f6441-75f3-4a8d-b4ae-057483c25e2d/dbs-animate-rotation