Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411492 Posts in 69377 Topics- by 58433 Members - Latest Member: Bohdan_Zoshchenko

April 29, 2024, 07:42:09 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)How to get into 3D programming?
Pages: [1] 2
Print
Author Topic: How to get into 3D programming?  (Read 4978 times)
hatu
Level 2
**



View Profile
« on: January 10, 2010, 02:11:29 AM »

I've been making 2D games forever but I've never really done anything but basic 3D stuff.
Now I'm trying to make a game in Unity with some procedurally generated stuff and it made me realize that I don't really understand how the underlying concepts work.

I know how to move and rotate and scale a model but as far as I know, the model works with magic.

What are some good resources for relative 3d newbies?
« Last Edit: January 10, 2010, 02:16:01 AM by hatu » Logged
starsrift
Level 10
*****


Apparently I am a ruiner of worlds. Ooops.


View Profile WWW
« Reply #1 on: January 10, 2010, 04:57:49 AM »

Prefaced with: I don't know anything about Unity.

I'm not sure what you're asking - how to use an API like OpenGL(YAY!) or DirectX(boo Sad ), how to think in 3D space, how to work with 3D modelling(skeletal v keyframe, model header files), or what? A lot of math can be involved, I typically have Wikipedia or a Uni calculus text open when coding non-content.

http://www.gamedev.net can be a good place to start, but they're typically C++/C# focused over there. A lot of the theory(how a graphics pipeline works, etc) is pretty plain though. http://www.opengl.org is also a good resource. If you're into hardcopy, the books by David Astle are great(site for them is http://glbook.gamedev.net/, can order from Amazon).
Logged

"Vigorous writing is concise." - William Strunk, Jr.
As is coding.

I take life with a grain of salt.
And a slice of lime, plus a shot of tequila.
powly
Level 4
****



View Profile WWW
« Reply #2 on: January 10, 2010, 05:37:53 AM »

The best way, I think, is first implementing a full 3D system (matrices, z-sorting, triangle rasterization) yourself first. When you know at least roughly how the stuff works in the inside, it's easier to use it yourself.
Logged
hatu
Level 2
**



View Profile
« Reply #3 on: January 10, 2010, 07:59:35 AM »

I should've been a bit more clear.

Like in Unity I can import a 3D model from the modeling software and play around with it but if I wanted to do anything on the lower level like I wanna do something to a specific polygon, I have no idea where to start.

I'm looking at a tutorial called Intro to 3D Graphics Programming: Volume I - V from gamedev.net and it seems pretty good so far.
Logged
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #4 on: January 10, 2010, 09:21:24 AM »

I'd take a look at the NeHe OpenGL tutorials. They're old, but still very good. It's how I first learned OpenGL, nigh 10 years ago.

http://nehe.gamedev.net/
Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
kometbomb
Level 0
***


View Profile WWW
« Reply #5 on: January 11, 2010, 03:04:21 AM »

3rding NeHe. Also, OpenGL is really nice in that you don't have to know about how stuff is really done today using vertex arrays and shaders and whatnot. You can experiment and learn the basics of 3D before having to learn the overly technical stuff that's there mainly for speed, not for usability.

Take a look at this. It's basically a OpenGL live sketching tool.

That said, if you're going to use OpenGL take this advice: check every call for errors. This is important since if there was an error and you don't check that, a perfectly working GL call will still report that earlier error. My preferred method for this is that I have a special class that has the error checking code in the ctor and dtor so that when the object comes in and goes out of scope, it will do everything automatically and I can define areas of interest by using the object scope. I.e.

Code:
void draw()
{
  {
    CHECKERR x("Points"); /* x will reset GL error state here */
    glBegin(GL_POINTS);

    ...

    glEnd();
  } /* x will do glGetError() here and display "Points" in the error message for quick id where it happens */

  do_other_stuff();

  {
    CHECKERR x("Triangles");
    glBegin(GL_TRIANGLES);

    ...

    glEnd();
  }  /* more error checking */
}
Logged

powly
Level 4
****



View Profile WWW
« Reply #6 on: January 11, 2010, 09:18:20 AM »

Vertex arrays are not "today", they have been with us from the late 90's and OpenGL 1.1. Today Vertex Buffer Objects (VBOs) are the usual way. They are very similar, VBOs just rest in VRAM instead of RAM. But your point is excellent, immediate mode (glBegin/glEnd) lets people learn with a slighter curve, you don't have to be setting up large structures if you just want a rectangle on the screen.

And yes, if someone wants to learn OpenGL, NeHe is the way to go. Fourthing, is that correct?
Logged
westquote
Level 0
**


I make games in Philly. How rare!


View Profile WWW
« Reply #7 on: January 11, 2010, 09:42:48 AM »

FWIW, though, you will want a fallback to Vertex Arrays if VBOs aren't supported on a platform that you are targeting.  An example of such a platform is OSX machines running Parallels.  Similarly, the iPhone, while "supporting VBOs", does not actually implement their back-end functionality, making them a performance pessimization, rather than an optimization.
Logged

Twitter: @westquote - Webpage: Final Form Games
Impossible
Level 3
***



View Profile
« Reply #8 on: January 11, 2010, 09:47:37 AM »

Makes me sad that people are still recommending NeHe.
Logged
kometbomb
Level 0
***


View Profile WWW
« Reply #9 on: January 11, 2010, 10:20:22 AM »

Makes me sad that people are still recommending NeHe.
The strong part of the tutorial series is that there is a lot of stuff that generally builds on the previous installment. In that it's much more of an OpenGL tutorial than the other "here, download the source code for the latest thing I learned from a slightly better writeup" style lessons.

I think it would be best to compare multiple tutorials and see what the similarities and differences are. Even the poorest tutorial can teach you very valuable things, as long as you recognize it as something not too good.

And I might add to me anything conceived after 1991 is new. And too loud.
Logged

powly
Level 4
****



View Profile WWW
« Reply #10 on: January 11, 2010, 10:21:46 AM »

Well then, Impossible, what would you recommend? If something newer meets NeHe's quality, I'd like to know about it.
Logged
Impossible
Level 3
***



View Profile
« Reply #11 on: January 11, 2010, 03:39:59 PM »

Well then, Impossible, what would you recommend? If something newer meets NeHe's quality, I'd like to know about it.
Depends on your definition of quality. As far as I know, there is no more modern equivalent of a NeHe style tutorial, but I haven't checked in a while.  Later NeHe tutorials do cover some newer techniques (how to use Cg shaders, VBOs) but not in depth. I wasn't a big fan of NeHe even when I was a graphics programming newbie\teenager and when the tutorials were relatively cutting edge. Now they seem that much more irrelevant. I understand the appeal of NeHe's tutorials I just don't like them.  I imagine that most of the recent newbie friendly graphics programming tutorials are done with XNA.
Logged
team_q
Level 10
*****


Divide by everything is fine and nothing is wrong.


View Profile WWW
« Reply #12 on: January 11, 2010, 07:36:38 PM »

I had great difficulty learning OpenGL 2 years ago, I found it difficult and it was one of my worst classes, I had a much easier time with DirectX, using C# XNA.
Logged

Dirty Rectangles

_PRINCE OF ARCADE_
FatHat
Level 1
*



View Profile
« Reply #13 on: January 11, 2010, 08:31:16 PM »

I'd learn the most bare metal API you can. MSDN is much maligned, but I learned most my initial 3D knowledge from reading the DX SDK docs and just playing with things. Books are nice, but in my opinion, its better to just be making things constantly, even if they suck. Forget theory, just get a triangle on the screen, and then add lighting, and then add texturing, and so on...

If you really want to learn 3d well, write a software renderer. It won't be useful, but you'll learn an unbelievable amount.

It's really hard to understand why a lot of high level API's do a lot of the things they do unless you've worked at the very low level. If you really want to learn a lot read Abrash's Black Book (its full of obscure arcana, but, you get a taste of what goes into a lot of this)
Logged
graydsl
TIGBaby
*



View Profile
« Reply #14 on: January 12, 2010, 08:44:25 AM »

I had great difficulty learning OpenGL 2 years ago, I found it difficult and it was one of my worst classes, I had a much easier time with DirectX, using C# XNA.

Word. XNA is a pretty good Framework (not an Engine!). It's simple to start with but you also have the flexibilty to do everything you want. AND you get the ability to release your game in XBLIG for free (almost... Hand Money Left).
Logged

Nothing creative here... I'm sorry.
knight
Level 3
***

aka dude4k


View Profile
« Reply #15 on: January 13, 2010, 07:29:51 AM »

If your looking into xna then you have to check out these shader tutorials http://forums.xna.com/forums/t/27849.aspx they are really helpful if you never used direct x shaders before.
Logged
Rob Lach
Level 10
*****



View Profile WWW
« Reply #16 on: January 23, 2010, 12:29:06 PM »

XNA is a great way to figure out how 3D programming works since they have pretty great samples and tutorials. After you get it down in XNA the switch to straight up DirectX or OpenGL becomes much simpler.
Logged

mewse
Level 6
*



View Profile WWW
« Reply #17 on: January 23, 2010, 05:44:22 PM »

An example of such a platform is OSX machines running Parallels.

Just checked.. at least on my computer (MacBook Pro, OS X 10.6.2, running Parallels Desktop 5.0.9308), Parallels does support VBOs.  Looking at the changelogs for Parallels, it looks like it's supported VBOs since at least major version 4.
Logged
BrianSlipBit
Level 1
*



View Profile WWW
« Reply #18 on: January 24, 2010, 07:37:59 AM »

I'd learn the most bare metal API you can. MSDN is much maligned, but I learned most my initial 3D knowledge from reading the DX SDK docs...

I'll second this.  In fact, the Direct3D 9 MSDN documentation is pretty top notch.  It's been around awhile at this point so it's pretty thorough.
http://msdn.microsoft.com/en-us/library/ee417873(VS.85).aspx
« Last Edit: January 24, 2010, 12:43:26 PM by BrianDFS » Logged

salade
Level 4
****



View Profile
« Reply #19 on: January 24, 2010, 09:55:04 AM »

I think someone disparaged buying a book, but I'm going through GameDev's openGL book, and it is quite good, although a tad old (not as old as NeHe though).

I've already programmed in openGL learning from NeHe and messing through the openGL reference, but the book is helping to clear some things up.

Also, check out Michael Abrash's stuff.
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic