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: Does anybody else know trig, but can't apply when scripting?

Previous Thread :: Next Thread 
1point29e5 is not online. 1point29e5
Joined: 23 Aug 2011
Total Posts: 18384
02 Jul 2014 04:28 PM
That's my huge problem.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
02 Jul 2014 04:29 PM
pretty much the same here.

I suppose that's because it's harder to visualise in some cases.
Report Abuse
luigi01302 is not online. luigi01302
Joined: 12 Jul 2009
Total Posts: 511
02 Jul 2014 10:09 PM
I know trig as well. It's a matter of knowing where to use it though that strikes me.
Report Abuse
Fluffmiceter is not online. Fluffmiceter
Joined: 28 Jan 2012
Total Posts: 6931
02 Jul 2014 10:59 PM
I still haven't quite figured out how to use trig when creating terrain.
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
02 Jul 2014 11:04 PM
I f you're planning on making an FPS, you can use it for blood splatters. That's all I know.
Report Abuse
noobertuber is not online. noobertuber
Joined: 16 Jan 2007
Total Posts: 2321
02 Jul 2014 11:12 PM
A few uses: getting the angle between two vecotrs, Spherical Linear Interpolation, smooth iteration, specific areas of raycasting, mouse gesture recognition, and much more. All in one script. Lots and lots of possibilities.

-God Bless-
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
02 Jul 2014 11:14 PM
I DON'T know trig, but I CAN apply it when scripting.

Thank you Google. Love you buddy.
Report Abuse
EchoReaper is not online. EchoReaper
Joined: 14 Oct 2008
Total Posts: 4323
03 Jul 2014 01:40 AM
I actually use trig a lot in building -- whenever I'm working with custom sized wedges, I'm usually try to fit them into somewhere (inb4that'swhatshesaid), so I use trig to get the sizing perfect instead of visually yoloing it.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
03 Jul 2014 02:59 AM
Trig can be really helpful, but when working with vectors you can generally avoid trig. Some helpful things to keep in your head when doing stuff in games:

Dot product:

  a:dot(b) = a.magnitude * b.magnitude * cos(angleBetweenThem)

  a:dot(b) / (a.magnitude * b.magnitude) = cos(angle)

  -- the vectors 'a' and 'b' are perpendicular
  a:dot(b) = 0

  -- for unit vectors
    a:dot(b) = cos(angle)

    a:dot(b) = 1 -- means they are equal

    a:dot(b) = -1 -- means they are opposites

  -- the point 'a' is on the plane with position 'p' and normal 'n'
  n:dot(a - p) = 0

  -- projects the point 'a' onto the axis 'b'
  b * b:dot(a)

  -- projects the point 'a' onto the plane with position 'p' and normal 'n'
  a - n*n:dot(a - p)

Cross product:

  a:cross(b) = a.magnitude * b.magnitude * sin(angle) * n
    -- n is a vector which is perpendicular to both 'a' and 'b'

  a:cross(b).unit = n -- to get the 'n'

  b:cross(a) = -( a:cross(b) )

Just experiment with these, visualize them with parts and such, and try things out. Or if you want to know the technical stuff behind them, just look 'em up. There's a ton of information online.
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
03 Jul 2014 07:11 AM
Why is the title of the thread me irl
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
03 Jul 2014 09:29 AM
Trig is confusing for GUIs, because the Y axis is backwards.
Report Abuse
Waterlimon is not online. Waterlimon
Joined: 25 Apr 2009
Total Posts: 18821
03 Jul 2014 09:31 AM
I first throw some trig functions in randomly and see if it works.

If it doesnt, I then graph the functions to see what they look like, or use the command line to calculate some example values.

If it still doesnt work I do it properly using the definitions.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
03 Jul 2014 11:00 AM
@king

the Y axis isn't backwards...

you're just being a newb
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
03 Jul 2014 12:05 PM
"the Y axis isn't backwards...

you're just being a newb"

Uh no. It really is inverted....
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
03 Jul 2014 12:09 PM
Yes it is. 90 degrees is usually straight up, but with the y axis increasing as it goes down ((0, 0) is in top left rather than bottom left) it ends up being straight down.
Report Abuse
Charl3s7 is not online. Charl3s7
Joined: 07 Dec 2007
Total Posts: 4146
03 Jul 2014 01:22 PM
Wow, Digpoe, that was so insightful, truly.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
03 Jul 2014 02:02 PM
The Y axis isn't backwards. It's just the origin is in the top left, when most of the time it is actually in the bottom left. It doesn't change anything, though.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
03 Jul 2014 02:08 PM
In computer graphics the y axis is normally like that, there is nothing odd with that. It's just like -z is normally treated forward in 3d. (For example a pixel with -z in front of the camera, or the negative z rotation vector is the front face).
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
03 Jul 2014 03:48 PM
"The Y axis isn't backwards. It's just the origin is in the top left, when most of the time it is actually in the bottom left. It doesn't change anything, though."

So yeah, when I see a coordinate grid, starting from the origin and going down, the numbers always get bigger and not smaller - which doesn't throw off the natural handling of trigonometric function quadrant handling or anything. Nope. How could I have been so dumb...
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
03 Jul 2014 03:50 PM
"Coordinate grid"

Am I the only person that says Cartesian plane?
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