Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to draw a simple house shape in c++

Posted on 1999-01-05
8
Medium Priority
?
3,850 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
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 1200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

885 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