sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [Plugin] Camera Stats

    已排程 已置頂 已鎖定 已移動 Plugins
    36 貼文 20 Posters 40.5k 瀏覽 20 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • M 離線
      MartinRinehart
      最後由 編輯

      @cmeed said:

      Can you tell me about imputing the aspect ratio? i use sketchup to design tv sets so 16:9. Also does the statistics window always disappear behind the main skp window? so we have to re-size our windows when its opened?

      Is it possible with this plugin to show a true camera zoom from a certain location? so i place my camera i can show what it looks like from this position and and THEN from that position what a zoom looks like?

      Sorry to be so long. Somehow I missed your post.

      On my PC, my stats window pops up in front of SketchUp. Stays in front until I click the SketchUp window.

      For zoom, use two scenes. Use the Cam Stats plugin to set both scenes' cameras to identical eye, target and up values, but different field of view values. The SketchUp animation should give you a proper zoom.

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 條回覆 最後回覆 回覆 引用 0
      • A 離線
        August
        最後由 編輯

        @tig said:

        A frustum is ... the camera's "view-box", in which there are objects that you will see...

        What most newbies don't know about are the near and far Clipping Planes. Anything closer than the Near Clipping Plane or farther than the Far Clipping Plane will not be displayed. If you could show things that were arbitrarily near or arbitrarily far, the math would require too many decimal places (or bits in the CPU).

        “An idea, like a ghost, must be spoken to a little before it will explain itself.”
        [floatr:v1mcbde2]-- Charles Dickens[/floatr:v1mcbde2]

        1 條回覆 最後回覆 回覆 引用 0
        • J 離線
          Jim
          最後由 編輯

          @martinrinehart said:

          On my PC, my stats window pops up in front of SketchUp. Stays in front until I click the SketchUp window.

          Need to open it modal on the Mac to make it stay on top. There is not a true modal WebDialog on a Mac as there is on Windows.

          Hi

          1 條回覆 最後回覆 回覆 引用 0
          • M 離線
            MartinRinehart
            最後由 編輯

            @jim said:

            Need to open it modal on the Mac to make it stay on top.

            Thanks, Jim.

            I changed it to "show_modal" but it turned the friendly little guy into a huge pain. Almost useless. Certainly no fun.

            Mac users: edit the code. It's ...Plugins/camera_stats/camera_stats.rb. Change the line at the bottom that now reads "wd.show()" to "wd.show_modal()". Is that better?

            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

            1 條回覆 最後回覆 回覆 引用 0
            • thomthomT 離線
              thomthom
              最後由 編輯

              @martinrinehart said:

              I changed it to "show_modal" but it turned the friendly little guy into a huge pain. Almost useless. Certainly no fun.

              What happened?

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

              1 條回覆 最後回覆 回覆 引用 0
              • cmeedC 離線
                cmeed
                最後由 編輯

                very good idea about the camera 'zoom'. I'll test your code for the mac users when i have the chance.... Work!!!

                1 條回覆 最後回覆 回覆 引用 0
                • RunnerPackR 離線
                  RunnerPack
                  最後由 編輯

                  Thanks, Martin. Another in a long line of very handy plugins! 😄

                  Just a couple of bugs to report, and one feature request:

                  First, I'm running XP SP3, SU 7.1.6860 (free version), and my IE is version 8.0.6001.18702. It seems to have problems when I use it, (which is rarely 😛 ) so it could be IE's fault, not yours... Anyway, I get the JavaScript error dialog shown in the attached image when I start the plugin (that is, when I open the window, not when SU starts).

                  Also, the "close" button on the Camera Stats window doesn't do anything (possibly related to the JavaScript error?).

                  Finally, the feature request:

                  It would be very handy if I could "pan" the camera left and right, relative to the viewport, by a specified value. For example, if I panned it right by about 2.5", it would be like I closed my left eye and opened my right (do you see where I'm going with this? 😉 ). I know (for me, anyway) the math would be pretty rough, but if you have the time, (you obviously have the grey-matter 😉 ) I would use this feature ALL OF THE TIME! 😄

                  Anyway, thanks again for the cool plugin!

                  EDIT: I just had another look at the Camera object API, and I think I know how to do this... Take the cross product of Camera#up and Camera#direction, use the resulting vector (or its negative) to transform Camera#target and Camera#eye, and use Camera#set to put it all back together. Am I close?

                  EDIT 2: ☀ Success! After just a bit of tinkering, I got it working! 😮 😲 😄

                  It's pretty much as I said above, but I had to experiment to find out how the API wants things done (plus I was a bit rusty at Ruby 😳)

                  I'm going to clean this up and make a new thread for it, just in case someone can use it, but here it is if you, Martin, want to incorporate it (not that you need my amateurish code 😉 ) or if someone wants to see what I'm blathering about 😉.


                  IE JavaScript error dialog


                  Stereo Panning Plugin (WIP)

                  You might have noticed... I'm a bit of a ferpectionist.

                  1 條回覆 最後回覆 回覆 引用 0
                  • W 離線
                    wwwyoose
                    最後由 編輯

                    Hi

                    I try this nice plugin but I dont get i work to export the camera position ...
                    or I do some wrong

                    some help who to...😄

                    Best Achim

                    1 條回覆 最後回覆 回覆 引用 0
                    • romboutR 離線
                      rombout
                      最後由 編輯

                      @martinrinehart said:

                      @jim said:

                      Need to open it modal on the Mac to make it stay on top.

                      Thanks, Jim.

                      I changed it to "show_modal" but it turned the friendly little guy into a huge pain. Almost useless. Certainly no fun.

                      Mac users: edit the code. It's ...Plugins/camera_stats/camera_stats.rb. Change the line at the bottom that now reads "wd.show()" to "wd.show_modal()". Is that better?

                      ii got this error

                      @unknownuser said:

                      Error: #<SyntaxError: /Library/Application Support/Google SketchUp 6/SketchUp/Plugins/camera_stats/camera_stats.rb:104: parse error, unexpected tIDENTIFIER, expecting kEND
                      target = make_arr( val )wd.show
                      ^>
                      /Library/Application Support/Google SketchUp 6/SketchUp/Plugins/camera_stats_menu.rb:10:in load' /Library/Application Support/Google SketchUp 6/SketchUp/Plugins/camera_stats_menu.rb:10 /Library/Application Support/Google SketchUp 6/SketchUp/Plugins/camera_stats_menu.rb:10:in call'
                      /Library/Application Support/Google SketchUp 6/SketchUp/Plugins/camera_stats_menu.rb:10

                      im working on mac su 6
                      before that line change it dint do any thing either

                      1 條回覆 最後回覆 回覆 引用 0
                      • thomthomT 離線
                        thomthom
                        最後由 編輯

                        Looks like target = make_arr( val )wd.show should be
                        target = make_arr( val ) wd.show

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

                        1 條回覆 最後回覆 回覆 引用 0
                        • TIGT 離線
                          TIG Moderator
                          最後由 編輯

                          There's a whole chunk of code lines between the two...
                          Did you do the edit in a plain-text editor like Notepad.exe ? [or MAC equivalent - perhaps BBedit??]
                          If you used a wordprocessor then it's added formating and messed up.
                          Start again with a new file download... 😕

                          TIG

                          1 條回覆 最後回覆 回覆 引用 0
                          • M 離線
                            manamana
                            最後由 編輯

                            This has been very useful - Thank you.

                            what do the three values of the "up" field represent?

                            1 條回覆 最後回覆 回覆 引用 0
                            • TIGT 離線
                              TIG Moderator
                              最後由 編輯

                              @manamana said:

                              This has been very useful - Thank you.

                              what do the three values of the "up" field represent?

                              The camera's 'up' is a vector [x,y,z]

                              TIG

                              1 條回覆 最後回覆 回覆 引用 0
                              • L 離線
                                luismoreno
                                最後由 編輯

                                This is a good plugin but it appears to work in inches only.
                                I've positioning a cámera at 2.00 meters height and Camera_Stats reports 78.74 units to Z eye and target coordinates.
                                It's possible ad all of the other units options (feet, milimeters, centimeters and meters) to plugin?
                                I don't know how to do due to my poor knowledge to ruby.
                                Thanks in advance.

                                1 條回覆 最後回覆 回覆 引用 0
                                • TIGT 離線
                                  TIG Moderator
                                  最後由 編輯

                                  @luismoreno said:

                                  This is a good plugin but it appears to work in inches only.
                                  I've positioning a cámera at 2.00 meters height and Camera_Stats reports 78.74 units to Z eye and target coordinates.
                                  It's possible ad all of the other units options (feet, milimeters, centimeters and meters) to plugin?
                                  I don't know how to do due to my poor knowledge to ruby.
                                  Thanks in advance.
                                  Eye and Target are Point3d x/y/z values in base-units [inches], Up and Direction are Vector3d x/y/z values.
                                  To make them into say 'mm' edit the main .rb file in the subfolder using Notepad.exe or a similar plain-text editor...
                                  Find the line that includes the text:
                                  ... $cam.eye().x() ...
                                  there are x/y/z versions for each of the 4 'types' of $cam methods... between lines #29 and #44 - 12 in all to change...
                                  Add to each as follows:
                                  ... $cam.eye().x()**.to_m** ...
                                  etc
                                  The additional ' .to_m' converts the passed value from inches into 'm'
                                  There are other converters too - ' .to_mm', ' .to_cm', ' .to_ft' etc ...
                                  So now at least you can convert your report to your desired units...

                                  TIG

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • L 離線
                                    luismoreno
                                    最後由 編輯

                                    Thanks, TIG.
                                    It appears running correctly.
                                    You are a champion.

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • C 離線
                                      cartersmith943
                                      最後由 編輯

                                      Thanks very much for the great plugin. I'm hoping to use it to show different variations of a product all next to each other within the same model. I'm trying to set a camera position in scene 1 to show product alt 1, slide the camera position along the x-axis for scene 2 to show the same view of alt 2, slide again for scene 3, etc.

                                      After making the changes in the script suggested to luismoreno the camera position is shown in millimeters, but when I enter a new x value, the camera position moves much more than I specified and all the values change not just the x value. I know nothing about writing script so I'm sure there's something I'm doing wrong ^^.

                                      Thanks in advance for any suggestions!

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • C 離線
                                        cartersmith943
                                        最後由 編輯

                                        Should have included this in my original question....After checking some more, it looks like the plugin is giving the camera location information in millimeters after changing the ruby script as TIG suggested. However, if you try to input new coordinates based on millimeters, the plugin calculates them as if they are inches. That would explain why entering an x value of 5000 and pressing Send Data gives a camera position with an x value of 127000. 5000 inches = 127000 mm. When I changed the models units to work in inches the plugin was great.

                                        Unfortunately anything beyond "find x and change it to y" gets out of my ruby script writing ability. This is a really valuable plugin and any suggestions on making it possible for those of us working in the metric system to use it would be much appreciated.

                                        Again, thanks very much in advance.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • greenskpG 離線
                                          greenskp
                                          最後由 編輯

                                          I'm sorry for ressuciting this topic but if i orbit my view with Ctrl pressed i get rotation in my camera. It's possible have this information?
                                          For example, create this same position and rotation in others 3d applications.

                                          Thank you in anticipation

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • josephkim626J 離線
                                            josephkim626
                                            最後由 編輯

                                            @tig said:

                                            @luismoreno said:

                                            This is a good plugin but it appears to work in inches only.
                                            I've positioning a cámera at 2.00 meters height and Camera_Stats reports 78.74 units to Z eye and target coordinates.
                                            It's possible ad all of the other units options (feet, milimeters, centimeters and meters) to plugin?
                                            I don't know how to do due to my poor knowledge to ruby.
                                            Thanks in advance.
                                            Eye and Target are Point3d x/y/z values in base-units [inches], Up and Direction are Vector3d x/y/z values.
                                            To make them into say 'mm' edit the main .rb file in the subfolder using Notepad.exe or a similar plain-text editor...
                                            Find the line that includes the text:
                                            ... $cam.eye().x() ...
                                            there are x/y/z versions for each of the 4 'types' of $cam methods... between lines #29 and #44 - 12 in all to change...
                                            Add to each as follows:
                                            ... $cam.eye().x()**.to_m** ...
                                            etc
                                            The additional ' .to_m' converts the passed value from inches into 'm'
                                            There are other converters too - ' .to_mm', ' .to_cm', ' .to_ft' etc ...
                                            So now at least you can convert your report to your desired units...

                                            This is great TIG, it worked for my model as well.

                                            Although, I noticed there are something strange going on when I try to send the data in mm?
                                            I suppose, it is a lot more complicated. so I ended up just converting my mm values into inches.
                                            But, if there is any simpler solution, please let me know.

                                            Thanks in advance.

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement