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

Adding pitch yaw and roll to xyz of a location

Scheduled Pinned Locked Moved Developers' Forum
10 Posts 3 Posters 1.7k Views
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.
  • L Offline
    ladyquestio
    last edited by 13 May 2012, 21:15

    I have the cloud v6 ruby which allows for the x,y,z text input. Is there a script that can import all 6 values at one time?
    I need to be able to import the x,y,z,pitch,yaw,roll in one file for a flight path.
    example of what i need to do is like this:
    0,0,0,10,0,0
    10,5,5,0,45,0

    I know it can be done some how but I can't figure it out.

    1 Reply Last reply Reply Quote 0
    • S Offline
      sdmitch
      last edited by 14 May 2012, 02:12

      @ladyquestio said:

      I have the cloud v6 ruby which allows for the x,y,z text input. Is there a script that can import all 6 values at one time?
      I need to be able to import the x,y,z,pitch,yaw,roll in one file for a flight path.
      example of what i need to do is like this:
      0,0,0,10,0,0
      10,5,5,0,45,0

      I know it can be done some how but I can't figure it out.

      I have a basic CSV_Import plugin on my blog that can be easily modified to suit or at least demonstrate how it is done.

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

      1 Reply Last reply Reply Quote 0
      • L Offline
        ladyquestio
        last edited by 20 May 2012, 11:31

        @unknownuser said:

        I have a basic CSV_Import plugin on my blog that can be easily modified to suit or at least demonstrate how it is done.

        Thanks for that information
        I can at least import the data
        Now what I need to do is integrate the rotations to a selection of a component I place in my model.

        http://userimages-akm.imvu.com/userdata/18/57/26/06/userpics/Snap_11619393714fb8d7bb434a2.jpg

        I have an understanding of the code needed for rotations.
        I import x,y,z,rotx,roty,rotz
        With your routine to draw the lines needed.
        So if I use the rp point as my location to put the item.
        Where rp=pt(x,y,z) point at end of line from your script.

        		rxv=Geom::Vector3d.new(1,0,0) *** the x axis
        		ryv=Geom::Vector3d.new(0,1,0)*** the y axis
        		rzv=Geom::Vector3d.new(0,0,1)*** the z axis
        		ss.each do |ent|
        		ent.transform!(Geom::Transformation.rotation(rp, rxv, rotx.degrees))
        		ent.transform!(Geom::Transformation.rotation(rp, ryv, roty.degrees))
        		ent.transform!(Geom::Transformation.rotation(rp, rzv, rotz.degrees))
        

        How would I do this?

        Thanks,

        1 Reply Last reply Reply Quote 0
        • S Offline
          sdmitch
          last edited by 20 May 2012, 15:12

          In addition to the rotation, you will need to do a translation to move the selected component to the new location.

          Geom::Transformation.translation(old_point.vector_to(new_point))

          Is this suppose to produce an animation? If so you will need to include pauses using sleep(length_of_pause).

          In the rotation, you can use the Sketchup constants X_AXIS,Y_AXIS,Z_AXIS instead of defining your own.

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • L Offline
            ladyquestio
            last edited by 20 May 2012, 18:04

            @sdmitch said:

            In addition to the rotation, you will need to do a translation to move the selected component to the new location.

            Geom::Transformation.translation(old_point.vector_to(new_point))

            Is this suppose to produce an animation? If so you will need to include pauses using sleep(length_of_pause).

            In the rotation, you can use the Sketchup constants X_AXIS,Y_AXIS,Z_AXIS instead of defining your own.

            This is for a flight path key frames. The components location, as well as its pitch, yaw and roll (rotations on it's x,y,z axis) are for basically changes in an items orientation and direction of travel.

            I can do it if need be by using several different ruby scripts, like pathcopy to put the component at the line end points. Then manually selecting each one and making the rotations one at a time(which takes hours to do) but I am trying to do it with a script to save time.

            So any help is really appreciated.

            1 Reply Last reply Reply Quote 0
            • S Offline
              sdmitch
              last edited by 20 May 2012, 20:23

              So you want to place a copy of the component at each xyz and rotate it by the given roll, pitch and yaw. But shouldn't the x, y, and z axes be determined by the heading at each point and not axes of the model?

              Nothing is worthless, it can always be used as a bad example.

              http://sdmitch.blogspot.com/

              1 Reply Last reply Reply Quote 0
              • D Offline
                Dan Rathbun
                last edited by 20 May 2012, 22:36

                I thot Martin Rinehart did this with a biplane model ??

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • L Offline
                  ladyquestio
                  last edited by 21 May 2012, 10:24

                  @sdmitch said:

                  So you want to place a copy of the component at each xyz and rotate it by the given roll, pitch and yaw. But shouldn't the x, y, and z axes be determined by the heading at each point and not axes of the model?

                  Yes, it goes from then end of one line made to the other end and that is the general line of travel on the x,y,z position. Which locate the position of the action. However, the pitch, yaw, and roll (rotations) are the orientation of the model at that location. And along the line of travel. as to the question of timing that is done by delaying the action at a particular point like at the line end through duplication of that particular key component placed there.
                  This is an example of what i am trying to do:
                  Numbers are in feet, x,y,z where x is direction of travel, y is left/right, z is up/down.
                  START: 0,0,0,1
                  LIFTOFF: 0,0,8 over the course of 4 seconds.
                  PAUSE: for 5 seconds.
                  fly : 150,0,0 over the course of 10 seconds
                  :turning to look back at primary model as it travels to next point.
                  PAUSE: for 5 seconds action
                  ROTATE LEFT: 90 degrees over the course of 5 seconds.
                  go to: 400,0,0 over the course of 20 seconds.
                  PAUSE: for 5 seconds
                  ROTATE LEFT 90 degrees over the course of 5 seconds.
                  Gos to 150,0,0 over the course of 10 seconds
                  action :Barrel roll along travel path then rights it self at end of travel line.
                  PAUSE: for 5 seconds.
                  ROTATE LEFT: 90 degrees over the course of 5 seconds.
                  HEAD TOWARD PORT DOORS: 400,0,0 over the course of 40 seconds.
                  PAUSE: for 5 seconds.
                  ROTATE LEFT: 90 degrees over the course of 5 seconds.
                  LAND: 0,0,-8,
                  and rotates on x axis to original position

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdmitch
                    last edited by 21 May 2012, 19:06

                    Sorry for my denseness but are the x,y,z values absolute or delta values.

                    Nothing is worthless, it can always be used as a bad example.

                    http://sdmitch.blogspot.com/

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      Dan Rathbun
                      last edited by 21 May 2012, 19:07

                      @dan rathbun said:

                      I thot Martin Rinehart did this with a biplane model ??

                      You can see how Martin did things through this search of his posts:
                      http://forums.sketchucation.com/search.php?st=0&sk=t&sd=d&sr=posts&author_id=25586

                      then search within those results for "biplane"

                      I'm not here much anymore.

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

                      Advertisement