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

    Camera Rays wanted

    Scheduled Pinned Locked Moved Plugins
    35 Posts 4 Posters 4.6k 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.
    • A Offline
      August
      last edited by

      @chris fullmer said:

      ... I got tired of looking at it so I took a new approach. ...

      Thanks. I tried it; it works great. No bugs.

      However, like the earlier versions, it creates an infinite cline in both directions, not a true ray that starts at a point and goes infinitely in one direction. That's not a problem, just a curiosity. (If it's not "supposed" to be that way, it may be related to the bug -- just guessing.)

      Do you know why the cpoint at view.camera.eye is necessary? You don't appear to use the point. Is it a requirement for pickray to work? (Maybe the omission of a cpoint there is the source of the bug? More guessing.)

      Thanks again.

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

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        The cpoint is not needed for the code. I just like to put it there so I can see exactly where the camera was.

        As for the bug, I know that 7.1 added some sort of infinite line viewing bug. I thought it had been fixed, but maybe not? Or maybe we've uncovered another iteration of their bug. I noticed that clines are not clipping like they should. They do not appear to clip at the near clipping plane. i'm not sure if it has always worked that way. I really hate construction geometry, so I haven't used it enough to know how it used to behave compared to how it currently behaves.

        But the part where you said that it still produces an infinite line instead of a ray, I think that is a known bug. I'll see if I can track down the info on that bug if you'd like.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • A Offline
          August
          last edited by

          @chris fullmer said:

          ... But the part where you said that it still produces an infinite line instead of a ray, I think that is a known bug. I'll see if I can track down the info on that bug if you'd like.

          Thanks, but no need. It doesn't interfere with anything that I'm trying to do. I'm just curious.

          You have already been most helpful, and you've helped me get my feet wet in SketchUp Ruby again (after they'd dried out for nearly a year).

          And now that I've started wrestling with this, I've begun to appreciate your dislike/aversion for construction geometry. Modifying something that already exists is clearly much easier.

          Thanks again,
          August

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

          1 Reply Last reply Reply Quote 0
          • A Offline
            August
            last edited by

            @august said:

            [... if you activate the Select tool, it will not select. If you activate the Line tool, it will not draw. ...

            This bug is still there. Just to make it stranger, it seems to go away if you orbit, but if you return to the exact viewpoint, using either Previous View or a Scene, it appears to be stuck again.

            For example, with the Rectangle Tool active, the first InputPoint appears to be stuck at the Camera Eye. The second InputPoint will not go just anywhere, it appears to have to inference an object, just like when drawing a CLine. If you orbit away with Rectangle active, you can see that the first point is already set. If you press Escape, you can draw a normal rectangle, but if you return to the exact Eye view, that point is pre-picked again.

            Similarly for the Line tool. The first point is already picked and the only allowable lines are the ones that terminate on a pre-existing point.

            Clearly a bug.


            CLine InputPoint Bug.PNG

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

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              August, are you saying the that the bug is still present in the most recent snippet I posted?

              Chris

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • A Offline
                August
                last edited by

                @chris fullmer said:

                August, are you saying the that the bug is still present in the most recent snippet I posted?

                Yes, the above image was generated using your newest snippet, unchanged.

                I load your snippet, saved as a separate .txt file, make a few clicks that generate the desired clines, and then when I select the rectangle tool, as described above, the first rectangle inputpoint seems locked to camera.eye and the second point will, in this drawing, only reference one of Sang's points.

                I can orbit, draw a normal rectangle, and when I return to the original view, using Previous View or my Scene, the first inputpoint is locked at camera.eye again and the second inputpoint will not reference anything except Sang.

                I am getting the lines I want, and I can work around that input point locking, but I do think this is a bug in SketchUp, probably in .add_cline, maybe in view.

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

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  I am starting to think it has to do with the way I am making an inputpoint with view.inputpoint(x,y ). I think I might need to look that over a little closer. I think I am messing something up with the IP associated to that view. I don't really undestand how IP points work behind the scenes, but I have a feeling the way I am calling it is messing things up. Might be a bug, or could just be un-intended usage of an input point. This is something I would like to understand better, so I'll try to figure it out this weekend (I have been excited about a few ruby projects lately, so I am spending some time on ruby again, it is fun!)

                  Chris

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    August
                    last edited by

                    @chris fullmer said:

                    ... I think I might need to look that over a little closer. I think I am messing something up with the IP associated to that view. ...

                    If you are, then I have to presume that it is simply exposing the bug.

                    The fact that I can draw a normal rectangle after I have orbited to a new camera.eye position, but when I return to the previous camera.eye the bug returns, to my mind that cannot be your fault.

                    At the very least, that is a serious side effect that is not documented. I have pored over the doc for InputPoint, camera, and view, and I have found lots of typos and incomplete examples (my hunch is most of it was generated by @Last and has never been reviewed or edited since) but I have not seen anything that implies a locked InputPoint or that such a lock or any other status is restored when the camera.eye returns to a previous position.

                    Maybe somebody is trying some "optimization" to restore view parameters when using Previous View or Scenes and is accidentally restoring too much. That's a wild guess. I suppose that could be tested by seeing if there were some minimum number of other views to go to that would make the bug go away when you returned to the original view, maybe if you ensured that you didn't return using a Scene (which would be a logical state to restore to) but used manually saved and input camera parameters instead.

                    That's too much work for me to chase a bug, unless I had a hope that the effort would result in the bug getting fixed, but right now I don't have a minimal code fragment that shows the bug, and I'm not going to try to find one. If you do, let me know and I might be inspired to put some energy into writing up a bug report to Google.

                    @unknownuser said:

                    (I have been excited about a few ruby projects lately, so I am spending some time on ruby again, it is fun!)

                    Except when you spend hours and hours wrestling with a bug while presuming it's you not the implementation or the documentation.

                    OTOH, when it works, it's very satisfying, and there's something about getting an aesthetic, visual result that touches something primal.

                    Again, thanks for the help.
                    August

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

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

                      @august said:

                      At the very least, that is a serious side effect that is not documented. I have pored over the doc for InputPoint, camera, and view, and I have found lots of typos and incomplete examples (my hunch is most of it was generated by @Last and has never been reviewed or edited since) but I have not seen anything that implies a locked InputPoint or that such a lock or any other status is restored when the camera.eye returns to a previous position.

                      Yes... there are a few typos mentioned in this thread: http://forums.sketchucation.com/viewtopic.php?f=180&t=17047 But they have been review since @Last was taken over by Google. The state of the API docs are much better now then what they where. But there is still lots of room for improvements.

                      Now you can add your comments yourself to the API pages if you log in.

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

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        August
                        last edited by

                        @thomthom said:

                        ... Now you can add your comments yourself to the API pages if you log in.

                        Cool!

                        I'll look for the link the next time I see something.

                        @august said:

                        ... (my hunch is most of it was generated by @Last and has never been reviewed or edited since) ...

                        Sorry for the sarcasm.

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

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          August
                          last edited by

                          @august said:

                          Sorry for the sarcasm.

                          I should have remembered a rule from one of my college professors, Gregory Bateson, "Never an untrue word spoken in jest." Can still allow sarcasm, just not hyperbole.

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

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

                          Advertisement