| |
|
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 |
|
|
|
| 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 |
|
|
|
| 02 Jul 2014 10:59 PM |
| I still haven't quite figured out how to use trig when creating terrain. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 03 Jul 2014 07:11 AM |
| Why is the title of the thread me irl |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 09:29 AM |
| Trig is confusing for GUIs, because the Y axis is backwards. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 07 Dec 2007 |
| Total Posts: 4146 |
|
|
| 03 Jul 2014 01:22 PM |
| Wow, Digpoe, that was so insightful, truly. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 03 Jul 2014 03:50 PM |
"Coordinate grid"
Am I the only person that says Cartesian plane? |
|
|
| Report Abuse |
|
|