PDA

View Full Version : C++ newbie: 3D now!!!


C++++++
08-05-2005, 01:32 AM
bh
I'm about a month into C++, so consider me a dummy. I have a friend into LW. We wanto combine C++ & LW to make a tiny sort of "Hello 3D world" demo, where you could control a little character to move forward & turn clockwise & counter clockwise.
Can someone please guide me in this direction so that I could acheive this goal, or, if this is too unrealistic due to my early level, then please point me out directions as to how I could acheive the required knowledge to do so.

arnecls
08-05-2005, 10:13 AM
In what way do you want to combine LW and C++?
Do you want to export a figure (+animation) from LW to a self-written stand-alone application or do you want to script LW so that a Figure moves inside a viewport? (I'm not sure if LW is capable of such a thing but Maya is, so I'm wondering)

CiaránMurphy
08-05-2005, 10:20 AM
Regardless of what language you are using the questions will still be basically the same.

Ok so you know someone who can provide you with a model in LW format... so how are you going to load and display the file.
You're a newbie so I presume you won't be writing the display engine or file parser or any of the user interaction routines :-)
So you have two routes... either leverage LW itself (use their sdk) to create a custom little applet (see if this is allowed in their EULA), or use one of the multitude of standard frameworks available.
These frameworks generally support only a few standard formats (mostly game formats). So if you can get LW to export to one of the standard game formats then it'll be easier, otherwise you'll have to find/write a translator.

There are lots of books on this, but a good starting point would be to look at Direct X on MSDN!

arnecls
08-05-2005, 10:30 AM
There are lots of books on this, but a good starting point would be to look at Direct X on MSDN!

Just my opinion, but I think OpenGL is a bit easier to learn for beginners (more readable) and has the HUGE advantage that it's crossplatform. For the rest of the above - I agree with that.
Tutorials can be found anywhere on the net, have a look at

http://nehe.gamedev.net
http://www.opengl.org/documentation/red_book_1.0/
http://www.gamedev.net/reference/list.asp?categoryid=31
http://www.flipcode.com/cgi-bin/fckb.cgi?op=category&id=2

C++++++
08-05-2005, 12:43 PM
*Edited*
(see next post)

C++++++
08-05-2005, 03:26 PM
bh
Actually what I wanted was 1-2-3-steps instructions of making the 3D program without really understanding what I'm doing. Consider a guy off the street who never heard about C++, & you tell him:
1: Go to X website & download X Program called a C++ compiler.
2: Enter the following text in the compiler's text area;
#include <iostream>
using namespace std; etc. etc. etc.
3: Click on the "Compile & Run" button.
Presto! You have made a Hello-world program in C++!!! & the guy doesn't even understand what he did, though he sees his results.
Same too I'm looking for someone who could supply me with these 1-2-3 steps to make the mentionned 3D application, without even understanding yet whats going on. Example:
1: Download X 3D engine. Put In X directory (or whatever)
2: Copy X source code into project.
3: etc.............
(I'm using Dev-c++)

@arnecls: As mentionned, I'm a starter in C++, so i didn't really understand all the terms you used.... But I think that what you said:
Do you want to export a figure (+animation) from LW to a self-written stand-alone application
Sounds like what I'm looking for.

mummey
08-05-2005, 03:34 PM
bh
Actually what I wanted was 1-2-3-steps instructions of making the 3D program without really understanding what I'm doing. Consider a guy off the street who never heard about C++, & you tell him:
1: Go to X website & download X Program called a C++ compiler.
2: Enter the following text in the compiler's text area;
#include <iostream>
using namespace std; etc. etc. etc.
3: Click on the "Compile & Run" button.
Presto! You have made a Hello-world program in C++!!! & the guy doesn't even understand what he did, though he sees his results.
Same too I'm looking for someone who could supply me with these 1-2-3 steps to make the mentionned 3D application, without even understanding yet whats going on. Example:
1: Download X 3D engine. Put In X directory (or whatever)
2: Copy X source code into project.
3: etc.............
(I'm using Dev-c++)

@arnecls: As mentionned, I'm a starter in C++, so i didn't really understand all the terms you used.... But I think that what you said:

Sounds like what I'm looking for.

So... you want us to do all the work for you... Uh, no.

I'm a firmer believer in pointing people in the right direction, but have to be willing to go find out what is required to build what you're trying to do. The only thing you learn from step-by-step instructions is how to follow step-by-step instructions.

Kid-Mesh
08-05-2005, 03:42 PM
What your asking for is impossible. There is no 1-2-3 to 3D programming...more like 1-2-3.......1003....2100....etc.

Focus on C++ and Math for now.

C++++++
08-05-2005, 03:44 PM
bh
So... you want us to do all the work for you... Uh, no.
I was sure there's already some ready-made stuff out there to just "copy-paste-run" or something like that.

mummey
08-05-2005, 04:14 PM
bh

I was sure there's already some ready-made stuff out there to just "copy-paste-run" or something like that.

Why would you want it? Why not actually learn how to accomplish this yourself?

Nerd_Pack
08-05-2005, 05:34 PM
Alright, here's the steps, ready?

1. Create a model in LW and export.

2. Write a file parser to read the model into an OpenGL program (easier to read than DirectX, IMO) and display onto the screen.

3. Write mouse and keyboard interaction classes along with a camera class so you can control the interactivity.

1, 2, 3... see?


Not to be rude or insulting, but this is really much more involved than you might think, if you want to program it. You can export the model to a movie format or something, but to program this will take much more work. Sorry :shrug:

CiaránMurphy
08-05-2005, 05:43 PM
I doubt if you'll get anyone to give you those sort of instructions... to do things from scratch will take many 1000's of lines of code and many months of hard work. There are many different layers and engines that need to be written and it's not a weekend job! You seem to want instant gratification... well you'll never get INSTANT results but you can get close by just wiring together other peoples/companies prewritten components... but you're not really learning anything worthwhile then... just gluing other peoples work together.

If you don't yet have the skills to do that and just want some fun then I suggest a commercial 3d authoring package... something like Quest3D http://www.quest3d.com/ or 3dGameStudio http://www.conitec.net/a4info.htm or look at http://www.3dlinks.com/links.cfm?categoryid=3&subcategoryid=31

Kid-Mesh
08-05-2005, 06:19 PM
bh
I'm about a month into C++, so consider me a dummy......

.....I guess that sums it up eh :shrug:

mummey
08-05-2005, 07:19 PM
I doubt if you'll get anyone to give you those sort of instructions... to do things from scratch will take many 1000's of lines of code and many months of hard work. There are many different layers and engines that need to be written and it's not a weekend job! You seem to want instant gratification... well you'll never get INSTANT results but you can get close by just wiring together other peoples/companies prewritten components... but you're not really learning anything worthwhile then... just gluing other peoples work together.

If you don't yet have the skills to do that and just want some fun then I suggest a commercial 3d authoring package... something like Quest3D http://www.quest3d.com/ or 3dGameStudio http://www.conitec.net/a4info.htm or look at http://www.3dlinks.com/links.cfm?categoryid=3&subcategoryid=31

That's a bit of an exageration. I could have a mesh-viewer done in a couple of hours. Keep in mind though that I've spent the time in computer graphics to learn the concepts so I know exactly what I'm doing.

Show that you're willing to put in the time to learn computer graphics, and we would be more than welcome to help you. But the idea of any of us giving you 'short-cuts' to reach there would only insult the effort we put into learning it ourselves.

Just something to consider,
-b

.....I guess that sums it up eh :shrug:

Now now... let's play nice in this thread.

iC4
08-05-2005, 08:31 PM
you could purchase the opengl vtms from www.3dbuzz.com - they show you how to create your own obj viewer - which is basicly the same just an other file format to read...

daniel_arz
08-06-2005, 01:47 AM
You could also download the unrealengine2 and build your own game or mod alot more quickly than programming your own engine.

C++++++
08-06-2005, 10:45 PM
bh
@mummey:
So... you want us to do all the work for you... Uh, no.

I'm a firmer believer in pointing people in the right direction, but have to be willing to go find out what is required to build what you're trying to do. The only thing you learn from step-by-step instructions is how to follow step-by-step instructions.
Quote:
Originally Posted by C++++++
bh

I was sure there's already some ready-made stuff out there to just "copy-paste-run" or something like that.
Why would you want it? Why not actually learn how to accomplish this yourself?
Show that you're willing to put in the time to learn computer graphics, and we would be more than welcome to help you. But the idea of any of us giving you 'short-cuts' to reach there would only insult the effort we put into learning it ourselves.

Obviously I'm gonn'a learn it all slowly but surely, just that I want to make my own little preview, much like the Hello world program every C++ programmer makes before understanding anything. I'm not looking for someone who's gonna teach me everything in one shot, rather someone who will just instruct me.
But alright alright, I got the point, I'll learn everything first. But one thing's for sure, that when I finally get to know all the 3D stuff, one of the following two is gonn'a happen:
1: I will put together the full-1-2-3-easy-to-apply-even-if-you-don't-understand instructions to make the simplest 3D program, & make that available to the web.
2: Realize that #1 is impossible & just become like any other 3D programmer.......(not hard to guess whats gonn'a happen:))

Thanks for ur help guys.

montclaris
08-07-2005, 03:56 AM
I think you might find what you're looking for in the introduction chapter of the redbook. It's a good introduction to OGL and available for download here : http://www.opengl.org/documentation/red_book_1.0/
You'll find instruction on the libraries to link to and headers to include as well as a small program drawing a polygon. It makes use of GLUT, so it would work on any platform with minimum hassle of windows management. That's the easiest you'll get close to IMO.

I agree with others it won't get you a long way into 3D programming unless you read the following pages ;). But an "Hello world" program only teaches you how to call a printf function after all...

Hope it helps.
monk.

Stevemeister
08-07-2005, 08:10 AM
bh
I'm about a month into C++, so consider me a dummy. I have a friend into LW. We wanto combine C++ & LW to make a tiny sort of "Hello 3D world" demo, where you could control a little character to move forward & turn clockwise & counter clockwise.
Can someone please guide me in this direction so that I could acheive this goal, or, if this is too unrealistic due to my early level, then please point me out directions as to how I could acheive the required knowledge to do so.

Yes, it's unrealistic for your early level. However, if you choose DirectX and X files as your model format, your path will be shorter.

So here are some directions.

1.) Fully learn C/C++.

2.) Learn general Windows programming (skip MFC for now and pick up a book that only uses the Platfrom SDK). Learn how to: create windows and dialog boxes, use device contexts and paint with the GDI, create/load/save bitmaps, do file handling (the Windows way), create common controls, and pump windows messages. Learn to program the Windows-way as well (which is the C-way, though I prefer not to use Hungarian notation lol), and don't waste time writing object-oriented wrappers.

3.) If using DirectX, learn the basics of COM (interfaces, reference counting, GUIDs, smart pointers).

4.) Learn OpenGL or Direct3D.

5.) Learn DirectInput, and DirectShow/DirectSound (optional, though might as well look at it while you're at it). Note: The DirectShow SDK is distributed with the Feb 2005 SDK extras (and it's really fun playing with all the filter graphs and stuff).

6.) Learn how to import static geometry from LightWave LWO files. The LWO2 file format is described on the LWSDK documentation that comes on the first CD (though if you're using 8.3 log into the NewTek site and get it. It uses chunk tags, and it's really easy to write your own loader. However, to load models + animations, it depends on how you want your animation system to be built (skeletal or keyframe?). Either way reading LWS files is a painful task. LWS file are convoluted with tons of text file junk. It's best to write a Layout plugin (exporter) using LScript or the SDK that exports your mesh and bones (if using skeletal animation) into your own proprietary format. You could use X files if using DirectX, but the only working X file exporter for LightWave is boinked big time.

7.) Pick up a graphics book that covers skeletal animation (if using OpenGL). It's a simple concept, just vertices, weights, and quaternion rotations), and looking at how libraries such as Cal3D http://cal3d.sourceforge.net/ are built can be a big help. One nice thing about DirectX and X files is it handles animation for you (take a look at the SkinnedMesh sample and the Tiny.X file in the MeshViewer).

CGTalk Moderation
08-07-2005, 08:10 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.