Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Algebra basics are related to 3D...

Author
Message
Yodaman Jer
User Banned
Posted: 5th May 2008 19:23
I am currently living with some relatives of mine. My cousin had Algebra homework the other night and asked me if I could help. Now, I've never really touched on Algebra (I will be getting into that VERY soon luckily), and the problem that she had gotten stuck on was a 'Find the surface area' problem.

"Find the surface area? Could that possibly be related to programming and 3D modeling?" I asked myself after she was midway through solving the problem (by the way, I'm no longer terrified of math whatsoever. It's weird because I used to hate and suck at math, but I've actually taken to creating problems and solving them and practicing. It's easy). The answer I got was YES. Think about it, master programmers out there: Box collision detection in DarkBASIC. YOu have to get the XYZ coordinates right with the correct numbers. You have to divide it by whatever number is first, like:
*Not usuable code*
(X)0.0250
(Y)2.0
(Z)0.0250


That makes a small, rectangular cube have an invisible box around it, creating collision.

The way that I usually get the right size box is by experimenting with the values. That however takes a long time, so I wondered if anybody here has possibly used algebra basics and find the surface area techniques with 3D stuff before to, well, find the area of a block in 3D. Of course you already have to know the volume, otherwise it's a pointless attempt.


Thanks BigAdd!!
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 5th May 2008 19:31
I don't see how you could use the surface area to use in detecting collision, since you would in most cases check for collision based on real world coordinates on specific points or "lines" on an object.

But regardless, algebra is pretty important in most game application


Hurray for teh logd!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th May 2008 19:48
Math in general is important in games.
I made my final work for math about math in game programming.

It also covered collision and raycasting collision (eg. line3D-Triangle3D, line3D-sphere3D, etc.) to find the point of intersection.
There's quite some math that you have to use for it though...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 5th May 2008 20:20
Learning math makes me better at programming, and learning to program makes me better at math. It's a never ending upwards spiral.

Don't you just hate that Zotoaster guy?
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 5th May 2008 20:38
I'm a little confused. Are you asking if there's an easy way to make a collision box around an object without the guesswork? If so here's some pseudocode.



It could be further adjusted manually by simply adding + or -# to manipulate the values

Your signature has been erased by a mod because with the text beside the image it's way too long.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 5th May 2008 21:00 Edited at: 5th May 2008 21:01
Yes.

This psuedo code may be buggy as I didn't have a chance to test it, but from the top of my head:


Of course, you would combine all those IF statements into one IF statement seperated by AND, but i spread it out for readability.


Hurray for teh logd!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 5th May 2008 21:32
I made a good one in code snippets that allows you to rotate the box. It's really simple, just assume the point is in a different place, but relatively the same to the box at 0 degrees.

Don't you just hate that Zotoaster guy?
Yodaman Jer
User Banned
Posted: 6th May 2008 05:55
Quote: "'m a little confused. Are you asking if there's an easy way to make a collision box around an object without the guesswork?"


Not really, I was just curious to see if anyone had ever used this technique before for creating 3D models and/or programming.


Thanks BigAdd!!
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 6th May 2008 06:35
Quote: "Math in general is important in games."


Imagine that

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th May 2008 17:48
Quote: "Imagine that."


Lol...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 6th May 2008 18:26 Edited at: 6th May 2008 18:27
Yeah. Algebra basics are related to 3D, as is a lot of math. If you wanted to get the full scope of how much math is involved with games, I'd suggest really paying attention to the following in your school career:

Basic Math
Algebra
Geometry
Trigonometry
Calculus
Linear Algebra (Vectors, Matrices, and such)

I've been working on a software renderer for my final in my senior year AP Computer Science class, and my independent research project at Penn State. Most 3D rendering, in the background, is all Matrix and Vector math. But even in the actual 3D rendering of the scene, you will see steps in the process that go back to basic math and algebra.



AMD Opteron 185 2.6 Ghz | 2 GB RAM | 8800 GTS 640MB | Vista Home Premium
Yodaman Jer
User Banned
Posted: 6th May 2008 20:41
I think it's really cool that math is a part of everything, no matter what. Especially in games!


Thanks BigAdd!!

Login to post a reply

Server time is: 2024-11-20 04:32:20
Your offset time is: 2024-11-20 04:32:20