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

Perspective...

3 views
Skip to first unread message

Marc or Brandon Bagwell

unread,
Dec 31, 1998, 3:00:00 AM12/31/98
to
It's me again! I've got another question for you all. This one is a
good one too. Okay, I was at a friends house today, and I watched him
play Zelda (C) on his N64. This got me thinking... How do I do
perspective with QBasic?

I am an advanced QBasic programmer (text wise), but I have <<<NO>>>
graphic experiance. Is there a good tutorial out there for me to use?
Or better yet, how about some 1 on 1 help.

Keep in mind, I need to know about the following items/commands:

> Poke > Using BMP or PCX Files (preferably BMP)
> Peek
> Binary Files

Oh thank you...

Brandon (Brandos)

Irv Mullins

unread,
Dec 31, 1998, 3:00:00 AM12/31/98
to
Marc or Brandon Bagwell wrote:

> It's me again! I've got another question for you all. This one is a
> good one too. Okay, I was at a friends house today, and I watched him
> play Zelda (C) on his N64. This got me thinking... How do I do
> perspective with QBasic?
>
> I am an advanced QBasic programmer (text wise), but I have <<<NO>>>
> graphic experiance. Is there a good tutorial out there for me to use?
> Or better yet, how about some 1 on 1 help.

You won't like basic for games (way slow)
Try Euphoria - lots of games have been written in Euphoria, which can
easily manage 50 -60 fps graphics., and otherwise runs about 20x faster
than QBasic. Also, it has built-in commands to load/display/save bitmap
files,
and supports most any resolution and color depth.

A free public-domain version can be downloaded from
http://members.aol.com/fileseu
along with lots of sample programs.

Irv


Rob Kendrick

unread,
Jan 1, 1999, 3:00:00 AM1/1/99
to

In message <368C0E70...@flash.net>
Marc or Brandon Bagwell <mbag...@flash.net> wrote:

<snip>

> I am an advanced QBasic programmer (text wise), but I have <<<NO>>>
> graphic experiance. Is there a good tutorial out there for me to use?
> Or better yet, how about some 1 on 1 help.

One does /not/ do 3D graphics in any Microsoft BASIC, and expect it to be
speedy, or even slow, come to think of it.

What you want is to take a book out of your local library about x86 assember,
and then one of 3D graphics etc...

I can supply source to 3D stuff written in ARM assembler, using a VIDC20a
as the video processor, but I doubt that's much use to you.

Cheers,
Rob Kendrick

--
E28F0018 E5D02000 E232202A E4C02001 1AFFFFFB E28F0004 EF020002
EF020011 445D456E 5E435D0A 43670A42 59455849 0B5E4C45 0000002A
http://www.kiwisoftware.demon.co.uk
Remove NOTSPAM to email personally.
Computer: a device designed to speed and automate errors.


Ray Hidayat

unread,
Jan 1, 1999, 3:00:00 AM1/1/99
to

Marc or Brandon Bagwell wrote in message <368C0E70...@flash.net>...

>It's me again! I've got another question for you all. This one is a
>good one too. Okay, I was at a friends house today, and I watched him
>play Zelda (C) on his N64. This got me thinking... How do I do
>perspective with QBasic?
>
>I am an advanced QBasic programmer (text wise), but I have <<<NO>>>
>graphic experiance. Is there a good tutorial out there for me to use?
>Or better yet, how about some 1 on 1 help.
>
>Keep in mind, I need to know about the following items/commands:
>
> > Poke > Using BMP or PCX Files (preferably BMP)
> > Peek
> > Binary Files
>
>Oh thank you...
>
>Brandon (Brandos)

I've glanced at a tutorial and the thing to keep in mind is that the
further back you go, the smaller things get.


Unigni

unread,
Jan 1, 1999, 3:00:00 AM1/1/99
to
In article <76hpht$et8$1...@titan.xtra.co.nz>, Ray Hidayat
<The...@xtra.co.nz> writes
I've made a QB program that draws a perspective cube (using exactly the
same techniques as I was taught in Art lessons at school!), although
that was quite slow (lots of unneccessary lines).
Something like Zelda is probably a 3d polygon game (a bit like Quake)
which is quite difficult. At the moment I'm trying to make a 3d ray-
casting engine (like Wolfenstein 3d or a very simple version of Doom)
which does actually *work*, and not particularly slowly either, although
all the walls are distorted (giving them a 'organic' curved look!) The
3d effect is made by drawing it shorter (and darker) the further away it
is. If you want, I could send you the current version for you to look
at...
The most complicated bit of 3d graphics is probably the maths - once
you know that, the programming's not too hard. You just have to use sine
and cosine a lot :-) Get a few example programs (have a look at
www.qbasic.com - I found some stuff there) to find out how to draw 3d
cubes, then improve it until you've got something good!
I'm trying to learn 3d graphics at the moment and might buy a book
about it (probably for C++) some time - when (if?) I understand it, I'll
see if I can help you!
--
Philip Taylor
philip @ zaynar . demon . co . uk
http://www.zaynar.demon.co.uk/atr - Programming robots!

Arclight

unread,
Jan 1, 1999, 3:00:00 AM1/1/99
to Marc or Brandon Bagwell
Hi,

Well I'm guessing that by perspective you mean transforming a 3d object
into a 2d representation, with perpective transformation, so that things
look like they are going off into the distance,

and don't bother looking at most of the 3d programs you can get from
things like ABC, because they don't do the transformation correctly, and
produce fisheye distortion of the image,
they use a simple formula for transforming a point with actual X,Y,Z
co-ordinates, to screen X,Y co-ordinates.
something along the lines of :-
screen X = Actual X / Actual Z
screen Y = Actual Y / Actual Z

This as I mentioned before does not transform the point correctly, and
does not allow for using variable Field Of View (FOV)

to implement field of view you also need to work out the X,Y Components of
the Viewing distance this is calculated like this :-
dx= ( center_x ) / TAN ( FOV / 2 ) ;
dy= ( center_y ) / TAN ( FOV / 2 ) ;

and then to use this as part of your perspective transform you do the
following

x= center_x + (dx * x / z );
y= center_y - (dy * y / z );

if you are in 320x200 you will also need to multiply your x terms by a
correction value (200/240) as the pixels are not square.

TTFN
Arclight


0 new messages