generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Vector math

Previous Thread :: Next Thread 
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Feb 2017 03:59 PM
############## essentially trying to find the angle of change, i suppose filteringenabled or riot
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Feb 2017 04:00 PM
this is on print screen

/e5u0jr


filteringenabled or riot
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
07 Feb 2017 04:18 PM
Just get the angle between P1 and p.

V1:Dot(V2) == ||V1|| ||V2|| cos(anglebetween)
thus:

angle = acos(V1:Dot(V2)/(||V1||*||V2||))
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Feb 2017 04:21 PM
already did it, thanks anyways tho

arithmetic.getAngle = function(vec1,vec2)
local dot = vec1:Dot(vec2);
dot = dot/(vec1.magnitude*vec2.magnitude);
local acos = math.acos(dot);
return math.deg(acos);
end


filteringenabled or riot
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Feb 2017 04:45 PM
nvrm, trying yours

what do those two lines on each side represent

i would say math.abs but that's 1 line


filteringenabled or riot
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
07 Feb 2017 04:48 PM
uhm what you have is the exact same. The problem I assume you're having is that you're not accounting for the fact that the range of acos is [0, 180 degrees]
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Feb 2017 04:53 PM
well the problem is im trying to find the angle between two vector3's so i can utilize the rotation aspect of attachmentpoints with r15


filteringenabled or riot
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Feb 2017 05:07 PM
b


filteringenabled or riot
Report Abuse
cowsoncows is not online. cowsoncows
Joined: 11 Oct 2013
Total Posts: 2522
07 Feb 2017 05:13 PM
Hahaha, I have no idea what you guys are talking about. Time to go read some EgoMoose math tutorials.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image