Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Math Help - Move and Rotate a point around a new origin

  1. #16
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Hmm. Question: do you just need to do this once, or are you going to have to do this repeatedly for slightly different translations, rotations, antenna orientations, etc.?
    Follow Math Help Forum on Facebook and Google+

  2. #17
    Newbie
    Joined
    Jan 2011
    Posts
    13
    Repeatedly, for any angle of rotation and any position.

    Thanks for your help so far.
    Follow Math Help Forum on Facebook and Google+

  3. #18
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Are you going to have to do these computations at run-time, or can you get away with doing it at edit time? I guess where I'm going with this is this: you're not going to want to do all these computations by hand. You're going to want to set up a function, maybe, to do these computations for you.
    Follow Math Help Forum on Facebook and Google+

  4. #19
    Newbie
    Joined
    Jan 2011
    Posts
    13
    It will be run through a function, so that it can be applied to every map. We have a list of positions and rotations for about 150 antennas, and the function will go through all of them and calculate the changes that need to be applied. Each map has the bases in different rotations and positions, so it has to be fully automated. The function will be run at the start of the mission, and spawn them all.
    Follow Math Help Forum on Facebook and Google+

  5. #20
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Haven't forgotten you. I'm wondering one thing: what determines how much "extra rotation" you want to give the antenna (that is, what determines the new direction of the green light)?
    Follow Math Help Forum on Facebook and Google+

  6. #21
    Newbie
    Joined
    Jan 2011
    Posts
    13
    That must be computed. The only values known are the original position/rotatation and the position/rotation of the new base. Nothing about the new position/rotation of the antenna is known.
    Follow Math Help Forum on Facebook and Google+

  7. #22
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    This problem is starting to annoy me. Every time I think I've got my mind wrapped around it, and I know what to do, something comes up and confuses me. This is why I haven't been able to give you one nice, big post with all the operations necessary. What's confusing me right now is this: why, when the original green box has no rotation, does the green pyramid have rotations about more than one axis? Let's say that the pyramid is pointed in the +z direction. Then, if you wanted to rotate the green pyramid in place relative to the green box, you'd do the following: move the box/pyramid system so the pyramid is centered on the z axis, then employ a rotation on just the pyramid, then displace the box/pyramid system back to where it was. I would think the result should be something like this:

    Green box position: (0, 0, 0)
    Green box rotation: (0, 0, 0)
    Green pyramid position: (-24.81, 43.0345, 4)
    Green pyramid rotation: (0, 0, 0.64).

    But you have

    Green box position: (0, 0, 0)
    Green box rotation: (0, 0, 0)
    Green pyramid position: (-24.81, 43.0345, 4)
    Green pyramid rotation: (0, -0.22, 0.64).

    Why the -0.22 in the y rotation for the green pyramid in the starting position? I can't get my head around this one.

    I have another question: Why can't you simply attach the antenna to the base in your model? Wouldn't that make this whole process easier?
    Follow Math Help Forum on Facebook and Google+

  8. #23
    Newbie
    Joined
    Jan 2011
    Posts
    13
    The green box and pyramid were just a hypothetical example to explain the situation. The numbers I posted are from an actual setup. The green pyramid is the original location of the antenna, which happens to be rotated on the y and z axes. As I said earlier, I have a list of about 100 antennas, and some have rotations on all three axes. I can't attach the antenna to the base because it can't be done like that. I can't rotate a group of objects, I can only move and rotate one at a time.

    What we are working on is an anti-cheat script. What we did is took several of the most popular bases, moved them to 0,0,0 and put the rotation to 0,0,0 while in the mission editor. Then, we put the antennas all over the bases, and recorded their positions and rotations. We have over 700 maps on the server, whenever a map is started that has one of the bases we have antennas set up for, it will spawn them all over the base with those positions and rotations. The problem is that those bases do not have the same positions and rotations. Some of the bases are rotated on all three axes, so we need some formulas that can figure out how to rotate and position the antennas correctly.
    Follow Math Help Forum on Facebook and Google+

  9. #24
    Newbie
    Joined
    Jan 2011
    Posts
    13
    Any thoughts on this? I know this is a difficult problem, and I'm not in a rush. I've tried asking for help on other forums, and I either don't get a reply, or they say to look into Quaternions, which I don't know how to use.
    Follow Math Help Forum on Facebook and Google+

  10. #25
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    You know what? I didn't give you the correct link in post # 14. I just linked to the rotation matrix link on wiki. I think you're still wanting to employ the algorithm in post # 14. But here's the link that'll show you how to do the translations (and rotations) using 4 x 4 matrices. Take a good, long look at that link, and see if you don't come up with some ideas.
    Follow Math Help Forum on Facebook and Google+

Page 2 of 2 FirstFirst 12

Similar Math Help Forum Discussions

  1. Contraction mapping of a cone, show origin must move.
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: August 15th 2011, 11:18 AM
  2. Rotate a rectangle with respect to a point
    Posted in the Trigonometry Forum
    Replies: 2
    Last Post: August 20th 2009, 02:13 AM
  3. Rotate a line about a point
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: August 18th 2009, 10:24 AM
  4. move a point along a plane in 3d space
    Posted in the Calculus Forum
    Replies: 3
    Last Post: June 22nd 2009, 11:27 AM
  5. Using sin and cos to rotate a point
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: September 10th 2007, 09:07 AM

Search Tags


/mathhelpforum @mathhelpforum