Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Isometric Perspective?

Author
Message
Invincibob 8
17
Years of Service
User Offline
Joined: 4th Feb 2008
Location: Some Place Somewhere
Posted: 14th Sep 2008 02:51
If I use 2d isometric sprites, how would I get the correct collision, and control what draws over what and when it does? Basically, I want an isometric tutorial, or at least an understandable explanation.

Once, I fell of a bridge and died. When I came back, I decided to haunt this forum.
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 14th Sep 2008 07:00
I know there was a thread that attempted to do a project with an isometric RPG, but I forgot the name. I'll try to dig it out. It had a bunch of links to isomeric tutorials. However, the best way to get tutorials on anything is to search it on Google!

"I reveal my trap card, GEORGE DUBYA BUSH!
America loses 2000 Life Points! America loses." -Deucalion2
Invincibob 8
17
Years of Service
User Offline
Joined: 4th Feb 2008
Location: Some Place Somewhere
Posted: 14th Sep 2008 16:50
I don't know, most of the results I get are for pixelling isometric sprites..

Once, I fell of a bridge and died. When I came back, I decided to haunt this forum.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Sep 2008 23:32 Edited at: 14th Sep 2008 23:33
Quote: "I know there was a thread that attempted to do a project with an isometric RPG"

I worked on that project, unfortunately it didn't get off the ground.

Here's some code I made for the isometric world...
(Use the directional keys to move around and shift/ctrl to move up and down.)

The functions that are of most interest to you are the ones that convert the 3D co-ordinates into 2D isometric...


This demo should be helpful, it shows how a 3D cube can be drawn and what happens to the 3D coordinates.


It is far better to complete a 10 line program than to start a 10,000 line program.
Invincibob 8
17
Years of Service
User Offline
Joined: 4th Feb 2008
Location: Some Place Somewhere
Posted: 15th Sep 2008 03:02
Okay, this'll help a lot. Thanks everyone!

Once, I fell of a bridge and died. When I came back, I decided to haunt this forum.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Sep 2008 22:12
I was playing around with isometric trying to understand it better myself and I wrote a program that I think is a bit like a boring slide-show but it might help you visualise isometric.


A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 18th Sep 2008 01:35
Wow, obese that is a pretty cool video/program tutorial. Very well done.

Now for my two cents:

The angles are 30,90,30 (x,y,z). If you keep that in mind it should be easier to work with (as always, I say you should use trig, but that's just one way, some people don't like trig)

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Sep 2008 00:49 Edited at: 19th Sep 2008 00:49
@BN2
Quote: "The angles are 30,90,30 (x,y,z). If you keep that in mind it should be easier to work with (as always, I say you should use trig"

I've found this formula very easy to use...

x= 2x/3 + 2z/3
y= x/3 + z/3 + 2y/3

But I haven't really pushed it so I don't know how accurate it is.
How would you use trig?

A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 19th Sep 2008 00:54
Those formulas would work.

x=starting point-z*cos(150)
y=starting point-z*sin(150)

Will project a point back along the x axis.

For the z axis, you change 150 to 30 and add the x, rather than subtract.

The starting point would be wherever you are projecting from.

Will write some code to demonstrate as soon as I reinstall darkbasic.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Invincibob 8
17
Years of Service
User Offline
Joined: 4th Feb 2008
Location: Some Place Somewhere
Posted: 30th Sep 2008 00:56
Wow, even more helpful advice, and I haven't even been flamed for asking. This is by far my favorite forum.

Once, I fell of a bridge and died. When I came back, I decided to haunt this forum.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 30th Sep 2008 11:31
Just to smooth this code out:



If you do the math of the sine and cosine every loop, you will waste some speed. Store the sine and cosine in variables:



You will save some speed.

TheComet

Suicide is away of telling God, You can’t fire me I quit !!!!!

Login to post a reply

Server time is: 2025-06-07 08:01:20
Your offset time is: 2025-06-07 08:01:20