Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 drawing pictures in c++
Index -> Programming, C++ -> C++ Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DanShadow




PostPosted: Fri Jul 02, 2004 2:45 pm   Post subject: 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.
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Fri Jul 02, 2004 2:50 pm   Post subject: (No subject)

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




PostPosted: Fri Jul 02, 2004 10:34 pm   Post subject: (No subject)

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




PostPosted: Fri Jul 02, 2004 11:45 pm   Post subject: (No subject)

there are many ways in which a bitmap can be drawn:
OpenGL - (included with most OSes) ogl will draw the map but to load them ull either need to use a secondary library (i use 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 [/url]- 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[/url] - 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)
SDL - A 2D graphics API, can draw the images but ull need to load them with 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




PostPosted: Mon Jul 26, 2004 6:27 pm   Post subject: (No subject)

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




PostPosted: Tue Jul 27, 2004 12:00 am   Post subject: (No subject)

dont bother using 3dxmax, just use blender, its alot esier
Mazer




PostPosted: Tue Jul 27, 2004 7:23 am   Post subject: (No subject)

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, I'ma cut you.
"But it's so weird, it's interface is impossible to use."
Is that why so many people use it? Blender's interface is the greatest thing I've ever seen. It's a bit more difficult at first, but it's worth it. Would you rather have to hunt through menus and tabs all over the place, or be able to use several good hotkeys (s = scale, r = rotate, g = grab, and more, of course) and press space to bring up a menu (at the location of your mouse) for nearly everything, with settings in a row of buttons at the bottom of the screen.

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




PostPosted: Tue Jul 27, 2004 7:28 am   Post subject: (No subject)

DanShadow wrote:
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




PostPosted: Tue Jul 27, 2004 12:42 pm   Post subject: (No subject)

heh nice mazer
DanShadow




PostPosted: Tue Aug 03, 2004 7:27 pm   Post subject: (No subject)

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




PostPosted: Wed Aug 04, 2004 6:25 am   Post subject: (No subject)

What's the difference? Are you referring to using 3d rendered sprites instead of models?
DanShadow




PostPosted: Wed Aug 04, 2004 8:07 pm   Post subject: (No subject)

I think so... Rolling Eyes
Mazer




PostPosted: Wed Aug 04, 2004 8:47 pm   Post subject: (No subject)

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




PostPosted: Thu Aug 05, 2004 3:49 pm   Post subject: (No subject)

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




PostPosted: Fri Aug 06, 2004 8:31 am   Post subject: (No subject)

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.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: