Solved

how to draw a simple house shape in c++

Posted on 1999-01-05
8
3,549 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 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

912 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

22 Experts available now in Live!

Get 1:1 Help Now