Extract !?
-
Please, would anyone document this extract:
This is an example of a simple animation that spins the model around
class ViewSpinner
def initialize
model = Sketchup.active_model
view = model.active_view
camera = view.camera
@target = model.bounds.center
@up = Geom::Vector3d.new(0, 0, 1)
@distance = camera.eye.distance @target
@zmin = @target.z
@zmax = @zmin + @distance
@dz = @distance / 300
@z = @zmin
@angle = 0
@frame = 0;
@startTime = Time.now
Sketchup::set_status_text($exStrings.GetString("FPS"), 1)
endThanks
-
Please put code in a 'code' block.
It is it is incomplete as it doesn't close the class and there are other methods in it too...
It's an example of an 'animation' from Google.
See here for the full code http://download.sketchup.com/sketchuphelp/gsu6_ruby/Sample%20Code/website/animationtests.rb
What do you mean by 'document'? Do you men 'explain' ?? The linked page has reasonable explanations I think.
If there's a particular line or two you'd like explaining please be more concise...
-
Thanks, the link you provided is straightforward.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement