Solved

how to draw a simple house shape in c++

Posted on 1999-01-05
8
3,523 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
8 Comments
 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
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
Comment Utility
>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
Comment Utility
>>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
 
LVL 32

Expert Comment

by:jhance
Comment Utility
jkr,

Did he say it _WASN'T_ Windows?  If it's not, then I'm sure he'll let us know....
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 86

Expert Comment

by:jkr
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now