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

    Truck & trailer application?

    Scheduled Pinned Locked Moved SketchyPhysics
    32 Posts 5 Posters 21.5k Views 5 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.
    • M Offline
      Mr.K.1
      last edited by

      Ya SP recording doesn't have on option to add camera recording, I guess in this case that is quite crucial... I don't know howmuch work it would be to add this, but I'll have a look at the files.
      You could also record it with Fraps, not really ideal but it's the only thing I know.

      Curves tend to flip directions at random, and not just when created but also when you open/close the file, it can't really be helped because only SU has full control over curves, so scripts need to be adapted.
      If you can't fix the script make a model with just the curve in question and your scripted object and I'll fix it up to work.

      1 Reply Last reply Reply Quote 0
      • W Offline
        wyatt
        last edited by

        Yeah, recording the camera view is really important. I have a screen recorder so if I can get the camera and curves working properly, I think I can get something usable, even if the files can't be modified.

        I attached a file with the curve reversed. The model actually contains two curves, an "original" that follows the terrain and a "simplified" that is a roughly straight-line approximation of the original. My first intention was to have the camera follow the actual terrain so I would have a constant 5' eye height, but the one time I actually got everything to work correctly that seemed to create jitters in the camera that I didn't like. So if the simplified curve will be smoother, I'm fine with the relatively constant eye height. I replaced the camera script I had tried previously with the one you wrote for softsoap. I only need the camera to move along the curve. The box pulling the car is only there because I want the view angle of the camera to adjust to the curve as it wiggles near the end, and to help achieve the more accurate eye height described above. Using the steering column is the only way I've been able to get the camera angle to adjust in that manner. Other than that, I have no need for the "car" itself.

        I am using your "speed control" script with the max_distance-frame lines added to try and reverse the curve. When I switched the equation to read distance=(frame-max_distance) the camera stayed at the proper end of the curve, but did not actually move as desired.


        CameraCurve.skp

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mr.K.1
          last edited by

          Alright did a quick fix up of SP files to add camera recordings, but make sure you backup your original files in case this doesn't work for you.

          So make sure you backup your /Sketchup/Plugins/SketchyPhysics3 folder, and then extract these two files in there.


          SketchyPhysics3.rar

          1 Reply Last reply Reply Quote 0
          • M Offline
            Mr.K.1
            last edited by

            I think this is how you wanted the script, try it and let me know.


            CameraCurve.skp

            1 Reply Last reply Reply Quote 0
            • W Offline
              wyatt
              last edited by

              The new SP code seems to work fine on a test model. I can't run the simulation on the cameracurve.skp though. I get the attached error. I'll try to download SU7 if you think that might be causing the problem.

              1 Reply Last reply Reply Quote 0
              • W Offline
                wyatt
                last edited by

                I copied everything into a new file and it works, but I'm not sure what it's doing. The car travels the right direction down the curve, but the camera watches the car as it goes by from about ground level. Should the camera be moved to the curve, or joined in some way to the car/box? If I read the script correctly, I thought the camera would get the car location whereever it was and follow it.

                1 Reply Last reply Reply Quote 0
                • W Offline
                  wyatt
                  last edited by

                  Alright, this is just bizarre. I downloaded the file again, copied everything to a new file, and the simulation seems to run ok now. ❓ The only thing this doesn't do is give me the first-person view that I need. I need the camera view to be coming from the box looking straight down the curve.

                  1 Reply Last reply Reply Quote 0
                  • W Offline
                    wyatt
                    last edited by

                    I think I just got it to work! I got rid of the car and the second curve entirely and added this code to the camera On Tick dialogue:

                    @RedAxis=1
                    @GreenAxis=0
                    @BlueAxis=00

                    target=$curEvalGroup.bounds.center
                    eye=[$curEvalGroup.bounds.center[0]-@RedAxis,$curEvalGroup.bounds.center[1]+@GreenAxis,$curEvalGroup.bounds.center[2]+@BlueAxis]
                    up=[0,0,1]
                    Sketchup.active_model.active_view.camera.set eye,target,up

                    I'll post the video once I get it cut. Crossing my fingers that there are no more big hiccups.

                    1 Reply Last reply Reply Quote 0
                    • W Offline
                      wyatt
                      last edited by

                      Here's the completed animation. Thank you so much for your help, Mr. K.

                      1 Reply Last reply Reply Quote 0
                      • F Offline
                        faust07
                        last edited by

                        Would be great if the modifications for camera recording (Mr.K.) could be integrated in to the improved version of SP by AntonS, if it isn't yet.

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

                        Advertisement