sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Hide at a distance from the camera - works but slooooowwww

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 216 Views 3 Watching
    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.
    • alexandre skA Offline
      alexandre sk
      last edited by

      Hello again.

      I was playing with the ruby and make a little plug in to hide everything away from the camera.

      Like this:

      plug1.jpg

      plug2.jpg

      plug3.jpg

      It work perfectly! but slow like a turtle! this scene above take about 20 seconds

      Here is the script:

      
      model=Sketchup.active_model
      eye=model.active_view.camera.eye
      selection = Sketchup.active_model.selection
      selection.each { |entity|
      	distance=eye.distance(entity.bounds.center)
      	if distance > 20000
      		entity.hidden = true
      	end
      }
      
      

      I think that calculate the center of all items is very hard work. Maybe you guys have a way that don't make the cpu calculate so hard. Or maybe what is taking time is to calculate the distance, then teh ideia is bad after all.

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        You could also adjust the fog settings.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • alexandre skA Offline
          alexandre sk
          last edited by

          well the idea is to work with large models, and don't have to manually hide objects to give more frame rate. I thinks fog don't help with less entities to display.

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            Fog generally tends to slow down the framerate.

            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