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.
Advertisement