
-----------------------------------
DanShadow
Fri Jul 02, 2004 2:45 pm

drawing pictures in c++
-----------------------------------
Ok, can someone please tell me the easiest possible way to load and draw images in c++?

In Turing its like:
Pic.Draw(picfile,x,y,picCopy)
In Java its like:
g.drawImage(picfile,x,y,this);

but I have no idea how to do it in c++! Someone please help, thanks.

-----------------------------------
AsianSensation
Fri Jul 02, 2004 2:50 pm


-----------------------------------
you can do it either with MFC, or OpenGL. I would hope you use OpenGL and not MFC.

Either way, they are not as simple as the Turing draw commands. go to http://nehe.gamedev.net/ for step by step OpenGL tutorial, or go and find a book on MFC. 

Though you'll kill yourself with MFC.....

-----------------------------------
DanShadow
Fri Jul 02, 2004 10:34 pm


-----------------------------------
hmm..I looked into openGL. (If you have a link for the download, plz send.) But I know there is a bit easier way to draw images..because I used to be a graphic designer for a c++ programmer, and he sent me his code. It draws tiles 256*256, just from a regular bitmap, and uses a bunch of complicated stuff like &engine and stuff. Is this MFC (er whatever)? If you could enlighten me, tx.

-----------------------------------
Catalyst
Fri Jul 02, 2004 11:45 pm


-----------------------------------
there are many ways in which a bitmap can be drawn:
[url=http://www.opengl.org/]OpenGL - (included with most OSes) ogl will draw the map but to load them ull either need to use a secondary library (i use [url=http://openil.sourceforge.net/]DevIL) or write ur own loading functions[url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/wingdistart_9ezp.asp]
Windows GDI - I dont know much about the GDI but im sure there is a way to load and display bitmaps (most likely what MFC uses)[url=http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000410]
DirectX - there is also a way to load and draw bitmaps using dx but im not sure of the specifics (most likely involves one of their utility libraries)
[url=http://www.libsdl.org/index.php]SDL - A 2D graphics API, can draw the images but ull need to load them with  [url=http://www.libsdl.org/projects/SDL_image/]SDL_image

There are also probably many more libraries that will also load and draw images as well, but those are the most prominent ones.  I myself use SDL for windowing (which ull need some sort of windowing solution for all of these) then OpenGL for drawing and DevIL for loading since they are all cross-platform.

-----------------------------------
DanShadow
Mon Jul 26, 2004 6:27 pm


-----------------------------------
Thanks guys. Ill be learning openGL with a friend of mine. And just wondering, how hard do you think it would be to manipulate 3D models using openGL from 3D Studios MAX? Or to incorporate movement of a sprite (game character), do I just make mini movies with a transparent backround having a creature (for example) move in a different direction (16 directions) for each movie?

-----------------------------------
Andy
Tue Jul 27, 2004 12:00 am


-----------------------------------
dont bother using 3dxmax, just use blender, its alot esier

-----------------------------------
Mazer
Tue Jul 27, 2004 7:23 am


-----------------------------------
Hahahaha! It HAS BEGUN.
*flies away*



*comes back*

*ahem* I'm going to preemptively lay the smack down to any Blender bashing.

Part One: But... but Blender sux0r!
Blender = free.
3DSMax != free.
3DSMax is mainly used by professionals who have legit copies of it. Blender is mainly used by -- get this -- hobbyists who have legit copies of it (because... well, it's pretty damn free right now) but are likely just using it to learn.

As a result, one would be more likely to find something incredible made with 3DSMax whereas with Blender you could find alot of stuff at the level of "Holy shit, this cube has 3D shading! I'm gonna go show my friends how leet I've become!" But if you look -- if you really look, you'll find some incredible things. Like Scott Wilkinson's incredible model and render of the Millenium Falcon (which landed him an offer of a job at Lucas Arts), which proves it's not the tool, just the people that use it.

Part Two: WTF? It is SO weird!
OMG, wow! Blender is different from other programs? Who the hell said they could do that? EVERYBODY knows that you can only make a program that looks like another program somebody else used!
Seriously, Part Two (b): What the hell? I can't do anything in this POS! WHAT? There's no UNDO! LAAAAMMMEE
I hate people like you. Really. You're so hooked on the undo function that you've forgotten that rule of saving often. Shame. Well, your bitching worked: Blender now has an undo function. Go rejoice close to the edge of a cliff.
As for your claim that Blender can't do anything: refer to "I'ma cut you" at the beginning of Part Two. I hope I never have to read another post from an ignorant pile of trash who doesn't bother reading through tutorials to figure out how to properly use Blender, and then claims that Blender isn't good. Life isn't easy, and in that respect 3D modelling isn't either. If you're using 3DSMax (I should say anything else, Maya, Lightwave, Wings3D, whatever), don't pretend you could just jump in and use it effectively without first reading tutorials.


OK, I think that covers the basics. I'll update it as necessary, but if nobody minds I'm just going to make a copy of this in the 3D section. If somebody could sticky it there, I'd really appreciate your show of humanity.

-----------------------------------
Mazer
Tue Jul 27, 2004 7:28 am


-----------------------------------
Thanks guys. Ill be learning openGL with a friend of mine. And just wondering, how hard do you think it would be to manipulate 3D models using openGL from 3D Studios MAX? Or to incorporate movement of a sprite (game character), do I just make mini movies with a transparent backround having a creature (for example) move in a different direction (16 directions) for each movie?
Manipulating the model would either involve keyframe animation (that's old stuff though, keep a copy of the vertex locations for each frame and change them), or armatures (assign each vertex to a bone (sometime two with weighting). Either way, it'll be a good deal of code that you'll need to write, unless you get some free code or you use a 3D engine. Still, it's always a good idea to read up on those things.

-----------------------------------
Andy
Tue Jul 27, 2004 12:42 pm


-----------------------------------
heh nice mazer

-----------------------------------
DanShadow
Tue Aug 03, 2004 7:27 pm


-----------------------------------
Ok. Anyways, at school I have free access to a legit copy of 3DSMAX, and was wondering if I really even need to manipulate the body parts of a creature, or rather just create the image of one moving.... Because it sounds seriously easier just to input a moving 3D image that to manipulate its body parts into making it look like its moving..

-----------------------------------
Mazer
Wed Aug 04, 2004 6:25 am


-----------------------------------
What's the difference? Are you referring to using 3d rendered sprites instead of models?

-----------------------------------
DanShadow
Wed Aug 04, 2004 8:07 pm


-----------------------------------
I think so... :roll:

-----------------------------------
Mazer
Wed Aug 04, 2004 8:47 pm


-----------------------------------
Well, you're going to have to manipulate the body parts of the creature if you hope to make the animation for all the frames of the sprite.

-----------------------------------
DanShadow
Thu Aug 05, 2004 3:49 pm


-----------------------------------
Ok..ill rephrase everything.
...I have access to a legit copy of 3DSMAX at school
...I want to make it so a creature can move in 16 different directions
.......and now-->
In 3DSMAX there is a feature to save animations (mini-movies) as a mini movie file. Can I import this movie file (using a different movie for each different direction), and edit its pos (x,y) on the map while it moves?

-----------------------------------
McKenzie
Fri Aug 06, 2004 8:31 am


-----------------------------------
Yes ... and no.
Depends on the game. If you are looking for a full 3D environment (any 3D shooter, flight sim...) then no you can not use 3DSMAX to export the animations. You must export the data from the model, and the texture. If you are looking to make a 2D game and give it a 3D look (called pre-rendered 3D like Heroes of Might and Magic III) than yes you can export the animation. Getting it into your program from there is still no piece of cake.

-----------------------------------
DanShadow
Thu Aug 12, 2004 1:16 pm


-----------------------------------
ok thanks.
