Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

creating a house in Quick Basic

8 views
Skip to first unread message

Carol14116

unread,
Oct 27, 2000, 9:44:15 AM10/27/00
to
Please, I need to create a house (with a door, a window, a roof and a color
change) in Quick Basic. Please, direct with assistance.

Judson McClendon

unread,
Oct 27, 2000, 5:01:43 PM10/27/00
to
"Carol14116" <carol...@aol.com> wrote:
> Please, I need to create a house (with a door, a window, a roof and
> a color change) in Quick Basic. Please, direct with assistance.

I understand that English may not be your native language. But
your post above can be interpreted in a number of ways. Your
phrase "create a house" is much too vague. It could easily mean,
for example:

1. You want to write a QuickBasic program to design house plans.

2. You want to write a QuickBasic program to display a picture of
a house on the screen.

3. You want to write a QuickBasic program to print a picture of a
house on the printer.

4. You want to write a QuickBasic program to create 'model' of a
house for 3D modeling.

5. You want to write a QuickBasic program to create 'model' of a
house for some kind of game.

And probably others. Each of the above would require different
explanations and programming techniques. Please post a more
detailed and explicit explanation of exactly what you are
trying to accomplish. We can't read your mind, only your words. :-)
--
Judson McClendon ju...@bellsouth.net
Sun Valley Systems http://www.sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."


KBH

unread,
Oct 27, 2000, 5:35:23 PM10/27/00
to

Wow. Well when you say "picture" I take it that you mean a 2-D drawing and
when you say "create 'model' " I take it that you mean a 3-D drawing?

So LINE, POINT, CIRCLE and setting colors should do it...

Judson McClendon

unread,
Oct 27, 2000, 6:19:50 PM10/27/00
to
"KBH" <K...@nomail.com> wrote:
>
> Wow. Well when you say "picture" I take it that you mean a 2-D drawing

Why?

> and when you say "create 'model' " I take it that you mean a 3-D drawing?

No, I mean that the house is described in internal variables, for
calculation and manipulation. For example, to do a 3D model of the
house, you might store the coordinates of the vertices of polygons
which make up the walls, floors, roof, etc., along with the color,
texture, reflective properties, etc. of each polygon. If you were
storing a 'model' of the house for a game such as Zork, you would
need a much simpler topological description, such as, for example,
a table with each entry representing a room, with its contents and
which exits lead to which other rooms. If it were a graphics game,
you would need to use both methods, or other structure(s) which
accomplish the same result.

> So LINE, POINT, CIRCLE and setting colors should do it...

You are only considering the *displaying* of the graphics on the
screen. The 'creation' of the house, one might suppose, could
also include the storing of the information necessary to generate
the appropriate graphics statements. But the original question
was so vaguely worded that what is desired is not clear. :-)

Judson McClendon

unread,
Oct 27, 2000, 6:49:52 PM10/27/00
to
1. Take a piece of paper (a finely divided graph paper would be best,
though not required) and draw a picture of the house on the paper,
using a pencil and a ruler.

2. Draw a rectangle around the house such that the height is 75% of
the length. This rectangle represents the screen borders, and
will give your house the proper scale when you draw it on your
computer screen. The larger you make the rectangle relative to
the house, the smaller the house will be on your screen, and
vice-versa. Position the rectangle such that the house appears
in the rectangle as you wish it to appear on the screen.

3. Assume the width of the rectangle to be 640 units, and the height
of the rectangle to be 480 units. Make the coordinates of the top
left corner of the rectangle to be x=0, y=0. X will increase to
the right from 0 to 639, and y will increase downward from 0 to
479.

4. Using the scale above, measure and calculate the coordinates of
each corner (where two or more straight lines meet), within the
640x480 coordinate system of the rectangle. For example, if your
rectangle is 8 inches wide and 6 inches high, and a point is 4.5
inches from the left of the rectangle, and 2.3 inches down from
the top of the rectangle, its coordinates would be:
x = 640 / 8 * 4.5
y = 480 / 6 * 2.3
Round each coordinate to the nearest integer. Do not use x values
greater than 639, y values greater than 479, or either less than
zero (negative).

5. Use the 'SCREEN 12' command to set your screen to 640x480x16 color
graphics mode, and clear the screen to black.

6. Use the 'LINE (X1,Y1)-(X2,Y2),COLOR' command to draw lines between
each of the coordinates where you want lines.

7. If you want a circle for the doorknob or a circular window, etc.,
use the 'CIRCLE' command (see description in manual or QuickBasic
help) to draw them. The 'POINT' command can be used to draw a
small dot.

8. For any parts you wish to other than black, select some coordinate
in the middle of the shape (not toughing any edge), and use the
'PAINT' command (see description in manual or QuickBasic help) to
'fill' that shape with the desired color.

9. When the drawing is complete, use the following loop to pause the
display until the user presses a key:

WHILE INKEY$="" : WEND

10. Use the 'SCREEN 0' command to clear and reset your screen back
to text mode.


--
Judson McClendon ju...@bellsouth.net
Sun Valley Systems http://www.sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."


"Carol14116" <carol...@aol.com> wrote:
I appreciate your response.
The correct answer (of your choices) to my "vague" description is number Two.
Please, I want to write a QuickBasic program to display a picture of a house
on the screen. The minimal requirements are one door, one window, one roof
and one color change.
I hope this is a good explanation.
Thanks again,
Carol

KBH

unread,
Oct 27, 2000, 8:16:28 PM10/27/00
to

Okay, "picture" means 2-D or 3-D drawing and "create 'model' " means to
store the coordinates of the drawing...

(That's a good idea because the house could be drawn any size by just
multiplying the house coordinates by a constant during plot.)

jdm

unread,
Oct 28, 2000, 11:43:15 AM10/28/00
to
There you guys go, doing somebody's homework for them again.

tch tch tch.

:-)

John M.

Judson McClendon

unread,
Oct 28, 2000, 12:19:43 PM10/28/00
to
"jdm" <jdm1intx@DIE_SPAMBOT_DIEhome.com> wrote:
>
> There you guys go, doing somebody's homework for them again.

Well, notice that I did not give any code. :-)

Derek Ross

unread,
Oct 28, 2000, 3:12:26 PM10/28/00
to

"jdm" <jdm1intx@DIE_SPAMBOT_DIEhome.com> wrote in message
news:nuCK5.45892$%t3.25...@news1.rdc1.tx.home.com...

> There you guys go, doing somebody's homework for them again.
>
> tch tch tch.
>
> :-)

More like doing their 'housework' for them this time! <heh, heh>

Cheers

Derek

KBH

unread,
Oct 28, 2000, 6:20:59 PM10/28/00
to

Well, here's an A-Frame:

SCREEN 7
COLOR 1, 7
PRINT "The A-Frame House"
LINE (155, 85)-(180, 110), 5
LINE (155, 85)-(130, 110), 5
LINE (130, 110)-(180, 110), 5
END

0 new messages