sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Fog Distance -what does it refer to?

    Scheduled Pinned Locked Moved Developers' Forum
    13 Posts 4 Posters 877 Views 4 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.
    • thomthomT Offline
      thomthom
      last edited by

      model = Sketchup.active_model #<Sketchup::Model:0xa0d2220> ro = model.rendering_options #<Sketchup::RenderingOptions:0x9d32a40> ro.each { |k,v| puts "#{k} - #{v}" if k.match(/Fog/) } DisplayFog - true FogColor - Color(204, 204, 201, 255) FogEndDist - 29208.58232374 FogStartDist - 20440.7040194069 FogUseBkColor - true nil

      Does anyone know what the Fog distances are relative to?

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • T Offline
        tfdesign
        last edited by

        Thom, Would it not be the thickness, based on a ratio of these two;

        FogEndDist - 29208.58232374
        FogStartDist - 20440.7040194069

        ?

        Just guessing πŸ˜„

        My book "Let's SketchUp!" Download from here

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          Yes, you'd get the thickness of the two. But they must refer to something still.

          I'm curious as I'd like to make a plugin that visually let you set the Start and End planes of the fog, instead of these sliders in the Fog menu which doesn't leave much fine control.

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

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

            FogStartDis is the distance from the camera's eye that the fog effect will kick in >0% obscuration - i.e. before that everything is not obscured at all.
            FogEndDist is the distance from the camera's eye that the fog effect has 100% obscuration - i.e. beyond that everything is obscured.
            The distances are measured along the vector from the camera's 'eye' towards its 'target'...

            TIG

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              hmm... But when I zoom in and out of a view, the the fog doesn't change. I thought the SU zoom actually moved the camera. But no?

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                Does makes sense though. I just drew a cline from the camera eye to the target and plottet some cpoint offset from the eye at the start and end distance of the fog.

                Interactive Fog tool next. Thanks TIG.

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • D Offline
                  designerstuart
                  last edited by

                  hey thomthom

                  was wondering if you'd made this plugin at all? (didn't see it in your sig link) if you have, i promise to make good use of it!
                  it sounds like to poor precision of this has bugged you like it has me - if no plugin do you know of a way i can carefully manipulate the fog, using script or something?

                  thanks

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

                    Typing this in the Ruby Console returns the 'end of the fog' in 'm' [when everything is obscured]
                    Sketchup.active_model.rendering_options["FogEndDist"].to_m 7.43732765885055
                    i.e. about 7.4m
                    This sets the end distance
                    Sketchup.active_model.rendering_options["FogEndDist"]=8.m
                    to exactly 8.0m

                    Similarly you can get/set the 'start of the fog' with
                    Sketchup.active_model.rendering_options["FogStartDist"].to_m 4.98010062093833
                    i.e. it's about 5m
                    and to reset
                    Sketchup.active_model.rendering_options["FogStartDist"]=4.m
                    to exactly 4.0m

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      designerstuart
                      last edited by

                      thanks TIG that's really useful.

                      @thomthom said:

                      I thought the SU zoom actually moved the camera. But no?

                      me too...... i have a scene with a section cut - what is the best way to move the camera a little closer to the cut so my fog works better?

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

                        Why not move the for start/end instead ?

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          designerstuart
                          last edited by

                          @tig said:

                          Why not move the for start/end instead ?

                          because my camera is a long distance away from the section cut which seems to reduce the precision with which i can set the fog. when the camera is closer to the cut i seem to have a lot more flexibility to control what is completely clear and what is fogged out. i did test it using your start / end tip tho, thanks.

                          so is it right that zooming in and updating my scene doesn't actually move the camera? 'walk' appears to be greyed out 😞

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

                            Sketchup.active_model.active_view.camera.eye
                            ==Point3d(-59.7779, -77.1402, 48.9843)
                            Sketchup.active_model.active_view.camera.target
                            ==Point3d(3.18141, -0.298445, 25.7127)
                            Sketchup.active_model.active_view.camera.eye.distance(Sketchup.active_model.active_view.camera.target)
                            ==102.029867652137

                            ZOOM

                            Sketchup.active_model.active_view.camera.eye
                            ==Point3d(-89.1738, -140.962, 69.414)
                            Sketchup.active_model.active_view.camera.target
                            ==Point3d(-26.2145, -64.1203, 46.1425)
                            Sketchup.active_model.active_view.camera.eye.distance(Sketchup.active_model.active_view.camera.target)
                            ==102.029867652137

                            You will note that the distance between the eye and target is unchanged on a ZOOM... but the eye/target location points do change.

                            If you have the Fog dialog open and zoom in/out you will see the fog adjusts relative to the eye, and the two fog sliders auto-adjust to suits - thus the fog start/end are dynamic, based on the eye/target which in turn are affected by the zoom and other camera settings...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              designerstuart
                              last edited by

                              thanks TIG
                              you are beginning to show me how skp REALLY works πŸ˜‰
                              so i think i can move my camera (accurately) a little closer by a combination of the above info - i can tell skp where to put the camera, fog start and fog end precisely using coords and these 'commands'

                              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