magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:27 PM |
I'm having a hard time thinking about this.
I need to rotate a square so its corners hit certain defined points. How would I go about this? |
|
|
| Report Abuse |
|
|
dbo12
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 600 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 24 Jul 2013 02:29 PM |
I don't really know...Make several clones of said part that are invisible and cancollide false, then make them each rotated slightly more until the corners get what you want, then remove all of the clones and make the original's rotation at that point?
~ Linguam latinam est optimum ~ |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:31 PM |
| An equation of some sorts would be much more preferred rather than trial and error. |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 24 Jul 2013 02:33 PM |
| Do you know the position of the 4 points? If so, I know what you need to do if you give me 5 minutes to work through it lol |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:34 PM |
| I know the position of the 4 points and the center of the square. |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 24 Jul 2013 02:34 PM |
| Oh lovely. Are the 4 points one of the axial planes? |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:35 PM |
| Could you also briefly say/describe what methods you are using? Like the names of the equations? I wish to learn a lot more about this. |
|
|
| Report Abuse |
|
|
Parthax
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 6941 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:35 PM |
| I'm not sure what you mean. They are just 4 Vector3 values. |
|
|
| Report Abuse |
|
|
J0SHlE
|
  |
| Joined: 09 Jul 2013 |
| Total Posts: 13 |
|
| |
|
Parthax
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 6941 |
|
|
| 24 Jul 2013 02:37 PM |
| scriptioli scriptioli give me the formuoli |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 24 Jul 2013 02:38 PM |
Easiest way:
midpoint = Vector3.new((point1.x-point2.x)/2,(point1.y-point2.y)/2,(point1.z-point2.z)/2)
part.CFrame = CFrame.new(part.Position,midpoint)
That just makes the brick look at the midpoint of two points.
So like A and B in this scenario are the two corners you're using AB CD |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 24 Jul 2013 02:40 PM |
@Oysi
My way cheats and is easier ok? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:49 PM |
I'm treating it as a square and not as a cube so I'm not sure how to define points such as back or right.
I put it in and its making the blocks y position 3.4x10^25 or so. |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 24 Jul 2013 02:51 PM |
@Oysi
orly? Hm, don't use CFrame ever because yolo I hate 3d workspaces. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 02:56 PM |
| But I only have 2 adjacent corners. (I know I messed up the position). |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 24 Jul 2013 03:00 PM |
| No it's in 3d space but im treating the brick as 2d (a square) as it is really thin. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|