sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Extract !?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 183 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      Larsen
      last edited by

      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)
      end

      Thanks

      [Every form of thinking perish by excess of its basic principles.

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        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... πŸ˜•

        TIG

        1 Reply Last reply Reply Quote 0
        • L Offline
          Larsen
          last edited by

          Thanks, the link you provided is straightforward.

          [Every form of thinking perish by excess of its basic principles.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement