Computer Science Canada

I need some tips with 3D graphics/coding

Author:  Danjen [ Sun Dec 30, 2007 6:58 pm ]
Post subject:  I need some tips with 3D graphics/coding

Now, I haven't been in a programming class for almost 1.5 years, and have not really programmed for almost as long, but recently, I wanted to get back into it. I have some general, more abstract questions related to full-3D games that are language independant.

I asked my math teacher how I should use 3d mathematics and he said to use vectors. I have no knowledge/experience with those yet, but if everything is relative to a point, what happens when a line or point has one axis with the same value as the relative point? Would that not produce a divide by 0 error, or is that where limits come in?

Also, in the tip of the day thread, Martin said to learn how to use bitshifts. Wikipedia did not provide why to use them. Any insights? Razz

Author:  Nick [ Sun Dec 30, 2007 7:10 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

was this the wikipedia page you read?
http://en.wikipedia.org/wiki/Bitwise_operation

Author:  Danjen [ Sun Dec 30, 2007 7:19 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

Yes, that was. I couldn't really make sense of the bitshift part, but the rest of it was completely logical.

Edit: Ahh, never mind I never really looked at it. It seems that bitshifting left/right appears to double or half the binary number. Still though, why should I learn / care how to do bitwise operations?

Author:  OneOffDriveByPoster [ Mon Dec 31, 2007 1:23 am ]
Post subject:  Re: I need some tips with 3D graphics/coding

Danjen @ Sun Dec 30, 2007 7:19 pm wrote:
Still though, why should I learn / care how to do bitwise operations?
http://en.wikipedia.org/wiki/Bit_manipulation
http://en.wikipedia.org/wiki/Bitboard
http://en.wikipedia.org/wiki/Bit_array
...
etc.

Author:  [Gandalf] [ Mon Dec 31, 2007 4:12 am ]
Post subject:  RE:I need some tips with 3D graphics/coding

Or right here on CompSci.ca, zylum's Turing Bitwise Operators tutorial, which should be easy enough to apply to whichever language you choose. Bit manipulation is definitely useful, but you might want to consider that it's not a prerequisite to learning 3D graphics.

Author:  Danjen [ Mon Dec 31, 2007 5:09 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

Quote:
Bit manipulation is definitely useful, but you might want to consider that it's not a prerequisite to learning 3D graphics.

Oh, of course I know that, but I was just curious. Smile
But I will definitely need help with the mathematics... Like for instance, how do you calculate the angle of an angle with 3 dimensions (x,y,z)?

Author:  Clayton [ Mon Dec 31, 2007 5:36 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

Add two vectors at a time.

Author:  Danjen [ Mon Dec 31, 2007 8:39 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

So like, if point A was (0,4,-2) and point B was (2,1,3), the vector angle would be (2,5,1)?? How would this translate into Turing?

Author:  HeavenAgain [ Mon Dec 31, 2007 9:37 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

add the same index? o.o

Author:  Saad [ Mon Dec 31, 2007 11:12 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

Instead of asking how to do it, search around in Google. It will probably be more helpful to you to find a bigger resource rather can constantly asking how to do it.
This is a good resource for 3D Math. Also I suggest you look into matrices if you want to make a 3d engine.

Author:  Danjen [ Tue Jan 01, 2008 12:12 am ]
Post subject:  Re: I need some tips with 3D graphics/coding

Thanks, just looking for a push in the right direction. Wink

Author:  abcdefghijklmnopqrstuvwxy [ Tue Jan 08, 2008 7:39 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

Whatever you do, don't make a 3d engine. Use one that's already available.

Author:  md [ Tue Jan 08, 2008 7:55 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

abcdefghijklmnopqrstuvwxy @ 2008-01-08, 7:39 pm wrote:
Whatever you do, don't make a 3d engine. Use one that's already available.
Why? Writing your own is how you learn! You get to see why things are written the way they are and what the pitfalls of different designs are.

Using code someone else has written will never teach you anything.

Author:  Tony [ Tue Jan 08, 2008 8:14 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

abcdefghijklmnopqrstuvwxy @ Tue Jan 08, 2008 7:39 pm wrote:
Whatever you do, don't make a 3d engine. Use one that's already available.


In fact, don't bother writing anything! Just pick up the latest version of Halo from the local Wallmart's electronics department, and frag some noobs. Laughing

I'm with md on this one -- there is a lot that can be learned, even from the very basics of a 3D engine.

Author:  abcdefghijklmnopqrstuvwxy [ Wed Jan 09, 2008 2:34 am ]
Post subject:  RE:I need some tips with 3D graphics/coding

You might learn a few things, but not as much as you'd learn actually making a game. Making an engine without any experience (for instance, not even knowing what a vector is) will get you nowhere. You will never succeed in making anything even half as useful as you would have if you'd spent time focusing on making a game and then crafting tools to help with specific things you need for your game. This was how engines were born in the first place. Someone did not just wake up with the design for an engine. It happened over a great length of time and process.

Create an engine if you want, you've been warned.

Author:  Tony [ Wed Jan 09, 2008 2:51 am ]
Post subject:  Re: RE:I need some tips with 3D graphics/coding

abcdefghijklmnopqrstuvwxy @ Wed Jan 09, 2008 2:34 am wrote:
You might learn a few things, but not as much as you'd learn actually making a game.

So having taken out all the engines, what are you left with for a game?

- User Interface
- scripting animations
- writing a story...

Author:  ericfourfour [ Wed Jan 09, 2008 2:15 pm ]
Post subject:  Re: RE:I need some tips with 3D graphics/coding

Tony @ Wed Jan 09, 2008 2:51 am wrote:
abcdefghijklmnopqrstuvwxy @ Wed Jan 09, 2008 2:34 am wrote:
You might learn a few things, but not as much as you'd learn actually making a game.

So having taken out all the engines, what are you left with for a game?

- User Interface
- scripting animations
- writing a story...


I think it should be pointed out that learning to do these is not a bad thing. You will learn the same amount from making a game and making an engine. However, they teach different topics. Making a game (from an engine) focusses on the creative side (like artwork and design) and less about programming. Making an engine focusses on the technical side (like physics and math) and more about programming. What to do depends on what the original poster wants to learn. If the original poster wants to know how to write a good story and draw good artwork then do not bother writing a game from scratch. If the original poster wants to learn the more technical side of game making, then making an engine would be a good idea.

Author:  abcdefghijklmnopqrstuvwxy [ Wed Jan 09, 2008 3:47 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

You definitely missed my point Tony. Read the part about "while making your game, develop tools that will help a specific aspect of your game." I'm quite certain I said something to that effect, because of course if you only script you aren't learning about a game engine at all.

Author:  Tony [ Wed Jan 09, 2008 4:08 pm ]
Post subject:  Re: I need some tips with 3D graphics/coding

abcdefghijklmnopqrstuvwxy @ Wed Jan 09, 2008 3:47 pm wrote:
if you only script you aren't learning about a game engine at all.

So what's your distinction between the graphics engine, physics engine,... sound, animation, AI, networking, etc?

What's the difference between detecting polygon collision in 3D space for the purposes for graphics vs. detecting polygon collision in 3D for the purposes of collision-detection/physics? Or do physics also hinder learning and should be dropped in as a 3rd party library?

Author:  ericfourfour [ Wed Jan 09, 2008 5:28 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

abcdefghijklmnopqrstuvwxy, I have a question:

What is a game engine that I can use that will teach me a lot of programming concepts? I'm not worried about the programming language.

Author:  abcdefghijklmnopqrstuvwxy [ Wed Jan 09, 2008 10:13 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

Tony missed the point again.

All I'm saying is one new guy with less than a few years experience programming in open GL or directx cannot create a worthwhile engine because he'll lose focus, won't know how to go about it, etc... If you think of all the people who've attempted to write a game engine on their own, you'll notice they were all noobs, failed, and learned there lesson.

A game engine is a huge undertaking that requires loads of experience, loads of time, and loads of people.

However if you want to create an engine the best way to go about it is to use an engine, create a game, figure out where the engine is lacking and add to the engine. Maybe you'll eventually decide the engine is flawed fundamentally and you need to recreate the whole thing.

ericfourfour, I don't know if you are being smug or what, but there is no engine designed to teach you programming concepts. But you can teach yourself programming concepts with the help of any engine.

Author:  md [ Wed Jan 09, 2008 11:02 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

Writing a decent game is not the point. Learning is the point.

So what if the engine sucks and doesn't do everything? It doesn't have to do anything. So long as he (or anyone) learns something from writing it then it's served it's purpose.

Author:  Tony [ Wed Jan 09, 2008 11:17 pm ]
Post subject:  Re: RE:I need some tips with 3D graphics/coding

md @ Wed Jan 09, 2008 11:02 pm wrote:
So long as he (or anyone) learns something from writing it then it's served it's purpose.

And that, abcdefghijklmnopqrstuvwxy, is the point. Wink

Author:  Clayton [ Wed Jan 09, 2008 11:41 pm ]
Post subject:  RE:I need some tips with 3D graphics/coding

Also note that a "worthwhile" game engine is very much representative of one's viewpoint. If one has had nothing to do with the development of said engine, and the engine sucks, then you will think it is a complete waste of your time. However, the person who actually wrote it, probably their first, will think quite differently.


: