Solved

how to draw a simple house shape in c++

Posted on 1999-01-05
8
3,646 Views
Last Modified: 2008-03-10
i'm looking for source code to draw a simple "house" in c++.
i.e. four walls and a roof. each wall should be a different colour as should the roof. it should be seen from an elevated position and slightly to the side. i'm not allowed to have any c++ graphic fuctions in the code i.e. it should be a program which does it pixel by pixel (i think!).
0
Comment
Question by:rskell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1181533
In case of windows:
Draw a picture in PaintBrush or something and now add this picture to your resources. Now you can display it from your resources.

Forget it, we need more info.
0
 
LVL 32

Accepted Solution

by:
jhance earned 300 total points
ID: 1181534
>i'm not allowed to have any c++ graphic

It sounds like this is some sort of homework problem.  Why don't you do a bit of research in the Windows SDK and try this yourself.  Then come back here and ask for some help on what you've already done.  Experts Exchange is not a "please do my homework for me" resource.

You might want to lookup the Win32 SetPixel() API function.

Another good resource is the Charles Petzold book, "Programming Windows"
0
 
LVL 86

Expert Comment

by:jkr
ID: 1181535
>>Why don't you do a bit of research in the Windows SDK and try
>>this yourself
jhance - did he mention Windows??? (Interesting 'answer' anyway: How to draw a house? See 'SetPixel()' or ask Petzold! <lol> ;-)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Expert Comment

by:jhance
ID: 1181536
jkr,

Did he say it _WASN'T_ Windows?  If it's not, then I'm sure he'll let us know....
0
 
LVL 86

Expert Comment

by:jkr
ID: 1181537
jhance,

i guess he will ;-)

I just thought you might have mixed up the C++ are with MFC or Windows (well, it sometimes happens to me ;-)
0
 

Author Comment

by:rskell
ID: 1181538
if you could just point me in the direction of a good resource
where i can find similar code and change it myself that would be great.
1
 
LVL 32

Expert Comment

by:jhance
ID: 1181539
I'm not sure what you're really asking about.  Do you need to know how to "draw" or how to "draw a house"?  

If you're asking how to "draw" in general on a computer display, then you can probably get some help here.  It's a very system/operating system dependent thing, however, and you haven't told us anything about your environment.  Is it WINDOWS, DOS, UNIX, X/Motif, Mac, Commodore 64, Nintendo, or what?

If it's how to draw a house in particular, I think you might want to consult an art book or something like that.
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1181540
There are no such things as C++ graphics functions so you should be safe there. Graphics functions are all implemented in software libraries that are mostly distributed with your compiler. Some windows API functions are available for drawing. You might want to use OpenGL for your "elevated position and slightly to the side" and then you could even rotate it.

Putpixel, LineTo, etc ... are all graphics functions provided with most compilers, but are all definately "c++ graphic fuctions".

You thus have a few options.
  1) Do not use C++ and use any graphics functions you like
  2) Use LOGO (I particularly like this one myself !)
  3) Get a class mate to do it for you and use C++ graphics functions (then you didn't)
  4) Declare it impossible and halt your studies. (Not recomended)
  5) Use printf and draw this : Simple House "seen from an
    elevated position and slightly to the side"

          o< ; ^)   /\
                     /  \
                    ------
                    |    |
                    ------

PS.

I think they should give a weekly prize on EE for the funniest comment by an expert ...

> ,,,, Commodore 64, Nintendo

HA HA HA HA HA ....

This made my day .
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question