# Omnimaga

## Calculator Community => TI Calculators => Axe => Topic started by: MGOS on April 27, 2012, 10:39:18 am

Title: 3D in Axe - Isometric Projection
Post by: MGOS on April 27, 2012, 10:39:18 am
Since I always wanted to make some 3D ish stuff in axe, I tried to figure out how isometric graphics work and made a whole bunch of functions to draw pseudo 3D tiles on the screen and to display an 8x8x8 bit array as a model made from little cubies.
It supports 3-level greyscale.

I will post code or a tutorial later if you are interested, this is just a preview of my upcoming stuff and what I've done so far.

?    ?    ?    ?    ?
Spoiler For the interesting stuff:
My editor for a 3D map:
(http://www.mirari.fr/W7DH)

(http://www.mirari.fr/dqZK)
The grey is better on calc.

Title: Re: 3D in Axe - Isometric Projection
Post by: Hayleia on April 27, 2012, 11:35:33 am
Interesting :)
What do you plan to do with it if everything goes well ?
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 27, 2012, 11:52:44 am
The next thing would be an Tilemapper, and then I will try to convert other stuff to this perspective, like buildings or vehicles.
A huge advantage is that this routine is incredibly fast (it uses only add, subtract and shift operations) so even complex stuff can be displayed with still an decent speed. The main speed problem are indeed the calculations to detect what is displayed first, what next etc. In my 3D editor program I always draw everything, so with the number of cubies the speed drops.
Title: Re: 3D in Axe - Isometric Projection
Post by: hellninjas on April 27, 2012, 12:01:58 pm
ehem... C&C in Axe! :D

I like the way this looks, and can't wait for the tutorial or download ^^!
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 27, 2012, 12:21:12 pm

Keys:
 Horizontal cursor movement: vertical cursor movement: Add block:Remove block:Clear all:Calculate random terrain (in progress):   Exit without deleting: Keypad 7|8|4|5 (just like the directions in the space)+ (deeper) - (higher)2nd (Hold and move for staight lines)ALPHADELMATHCLEAR
Because of the lag if there are many blocks, you sometimes need to hold a key instead of just a short click.

The model is saved to the first 64 bytes of L1, so it stays if you leave.
The Axe app and other programs use this space, so you can get some interesting shapes (e.g. if you compile).
Title: Re: 3D in Axe - Isometric Projection
Post by: Xeda112358 on April 27, 2012, 12:22:06 pm
Wow, this is great, nice job!
Title: Re: 3D in Axe - Isometric Projection
Post by: willrandship on April 27, 2012, 02:31:51 pm
hmm...what about having the graphics ala civilization 2? Basically, Isometric tiles with regular tiles set on top, overlapping the tops of the above tiles, but not below.
Title: Re: 3D in Axe - Isometric Projection
Post by: Xeda112358 on April 27, 2012, 02:43:30 pm
Oh wow, I never noticed program was uploaded because you ninja'd me D: Still, cool! I want to see if I can make something similar in Grammer :D I think I can make it not slow down no matter how many blocks there are.
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 27, 2012, 03:32:47 pm
I want to see if I can make something similar in Grammer :D I think I can make it not slow down no matter how many blocks there are.

Intresting. The basic way of transforming (X|Y|Z) (Z is depth) to (A,B) on the screen is:
Code: [Select]
`A = 2 * (Ymax + X - Y)B = X + Y + 2 * Z `
Title: Re: 3D in Axe - Isometric Projection
Post by: LincolnB on April 27, 2012, 08:03:58 pm
Looks really good, I'll have to check out the source sometime.
Title: Re: 3D in Axe - Isometric Projection
Post by: Yeong on April 27, 2012, 11:04:43 pm
now can you implement bigger cube? if you do? maybe someone can make FFT... :D
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 28, 2012, 02:12:25 am
now can you implement bigger cube? if you do? maybe someone can make FFT... :D

You can implement whatever you want. That's the strength of this method.
The problem is that you need twice as much data for an isometric tilemapper than for a normal (viewn from above, 3-level grey) tilemapper, even though the size of the tiles is the same. The cuby needs atm 48 bytes of data. If you made a flat isometric tilemapper, each (8x8) tile would need 32 bytes of data. You can imagine that an 8x8x8 pixel rough terrain tile or a character would need then 64 bytes.

I'm now gonna try to make a flat tilemapper.
Title: Re: 3D in Axe - Isometric Projection
Post by: Sorunome on April 28, 2012, 10:21:46 am
That looks pretty cool, the 3D tile-mapper O.o
Title: Re: 3D in Axe - Isometric Projection
Post by: DJ Omnimaga on April 28, 2012, 01:28:57 pm
Question, how is the speed if you make the map larger and allow tile-by-tile scrolling?

I remember people worked on such games before, but unfortunately they had problems with speed. I'm sure it can be done to run quite fast, but I am curious how.

Looks nice by the way!
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 28, 2012, 01:38:38 pm
The tilemapper isn't finished yet, but I'm able to display a tilemap and scrolle up/down and right/left. The main problem I have to solve is to detect which group of tiles actually needs to be drawn. Because I have a rectangular frame, it could be possible using an array mask with the coordinate offsets to one corner to move the whole map. This would need a lot of data, but once you figured out how that works, it'd be super fast I guess.
Title: Re: 3D in Axe - Isometric Projection
Post by: DJ Omnimaga on April 28, 2012, 01:46:59 pm
I see. As for the last tilemapper attempt, I think the slowdown was caused by having to figure out if a tile needs to be drawn or not, depending if it's behind another, and because of all the transparency and masks involved.

(http://www.omnimaga.org/index.php?action=dlattach;topic=8549.0;attach=7873;image)

The following was written in TI-BASIC with xLIB but it did not support variable wall heights and only supported going up and down, IIRC

(http://i199.photobucket.com/albums/aa72/builderboy2005/th_ANIMATION.gif)

Same for this (although this was written in Axe)

(http://www.omnimaga.org/index.php?action=dlattach;topic=6336.0;attach=5778;image)

The last one was an RPG, though, so not much speed was needed.
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 28, 2012, 02:01:49 pm
Wow, those are cool mappers. I think I will make it more like a flat terrain with 3D ish objects, so I do not really need to take care about the layers.
Maybe I will do the scrolling with the screen-shifting operations and only draw the tiles shifted in.

The middle one is sped up, right? I don't think TI-basic with xLib runs that fast on a 83+/84+.
Title: Re: 3D in Axe - Isometric Projection
Post by: DJ Omnimaga on April 28, 2012, 02:04:58 pm
Ah ok that's good then. Or another idea is that you can do like what they did in Mario RPG and design your maps so the higher stuff is always behind. As for the tilemappers above, they all run at SE speed. The reason why the xLIB one runs this fast is because all the author does is scrolling up/down and only draw one single row of tiles per frame. Also another reason why it's so fast is that it was written by Builderboy. :P
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on April 28, 2012, 04:20:06 pm
As for the tilemappers above, they all run at SE speed. The reason why the xLIB one runs this fast is because all the author does is scrolling up/down and only draw one single row of tiles per frame. Also another reason why it's so fast is that it was written by Builderboy. :P
Ok, that makes sense. Cause I have only a 83+, I will try it as fast as I can and I hope the games still will be playable.
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on May 01, 2012, 11:01:02 am
Two things:

Firstly, I won't be able to continue any of my project for two weeks, 'cause I'm going to the USA tomorrow (school exchange, yeah!).

Secondly, I finally got my super fast (due to 8 bit assembler LUT function and coordinate transformation algorithms) flat tilemapper for any size of map ready:

(http://img.removedfromgame.com/imgs/isomapper_1.gif)  (http://img.removedfromgame.com/imgs/isomapper_2.gif)
(again, better grey on calc)

The program lets you enter the size of the tilemap (only square maps, but other arbitary formats aren't any harder to implement), then it generates some random grey/white tiles and displays it on the screen. You can scroll around with the arrow keys.
Title: Re: 3D in Axe - Isometric Projection
Post by: TIfanx1999 on May 01, 2012, 11:12:42 am
That is looking great! Very impressive! =) I hope you enjoy your trip to the U.S. Myself and many other members live here. How long are you going to be staying?
Title: Re: 3D in Axe - Isometric Projection
Post by: MGOS on May 01, 2012, 11:15:37 am
How long are you going to be staying?
As said, two weeks. But our schedule is full of stuff we want to do.
Title: Re: 3D in Axe - Isometric Projection
Post by: TIfanx1999 on May 01, 2012, 11:20:15 am
Ah, I misread your post. I'm a bit sleepy at the moment. XD It should be a very nice experience. :D
Title: Re: 3D in Axe - Isometric Projection
Post by: LincolnB on May 01, 2012, 05:35:10 pm
That looks very good, I hope you post the source.
Title: Re: 3D in Axe - Isometric Projection
Post by: DJ Omnimaga on May 01, 2012, 07:40:46 pm
Looks very nice. And have fun in USA :)
Title: Re: 3D in Axe - Isometric Projection
Post by: squidgetx on May 01, 2012, 08:54:07 pm
I see. As for the last tilemapper attempt, I think the slowdown was caused by having to figure out if a tile needs to be drawn or not, depending if it's behind another, and because of all the transparency and masks involved.
(http://www.omnimaga.org/index.php?action=dlattach;topic=8549.0;attach=7873;image)
Oh, that looks like a familiar screenshot XD
Yeah, also remember that that gif is running 15 fps or whatever, so it'll look slow in chrome which caps at 9fps. But it was still too slow for practical use *sigh*. Though I did have a (slightly buggy) quadratic gravity/physics/collision engine running on top of that ;) The main reason it was so slow was actually because I didn't bother checking for whether or not a tile needed to be drawn...making it 5x slower than a normal 16x16 masked tilemapper by default. My advice would be to figure out an efficient way to accomplish that, since I was too lazy to XD
Title: Re: 3D in Axe - Isometric Projection
Post by: DJ Omnimaga on May 01, 2012, 08:59:50 pm
If you had used it for an RPG and got rid of the ability to go behind walls, however, it might have been just fast enough.

It seems in Mario RPG you could sometimes go behind tiles, but I'M sure an isometric game could be made so it's not possible.

(http://www.fantasyanime.com/squaresoft/mariorpg/maps/SuperMarioRPGRoseTown.png)

In Kirby Dream Course you could never go behind walls anywhere, because no map were designed to allow such thing. There were slopes, though.

Pretend there are bushes behind houses or put houses in the corner, somewhere where it's impossible to walk behind. Only have a few select portions of the map where you can go behind stuff and if you have any similar map, make them tile scrolling rather than smooth, so when moving behind stuff, you just make your character disappear entirely rather than going through the hassle of making him disappear partially.

After all, in most RPGs made before 1993, you can't even go behind walls.
Title: Re: 3D in Axe - Isometric Projection
Post by: Builderboy on May 01, 2012, 09:00:25 pm
Actually chrome doesn't have that cap anymore :D they fixed it ^^
Title: Re: 3D in Axe - Isometric Projection
Post by: squidgetx on May 01, 2012, 09:09:15 pm
@Builderboy
Wow, I didn't notice XD well now i just look silly :O haha

@DJ, hm sounds interesting...Maybe I'll pick this up after finishing Zombie Gun (Actually by then the contest might start..plus i want to work on Ash D:)
Title: Re: 3D in Axe - Isometric Projection
Post by: DJ Omnimaga on May 01, 2012, 09:15:27 pm
@Builder I know IE6 had it, though. Do newer version have it?

@Squidgetx hopefully you pick up Ash again in the future :D
Title: Re: 3D in Axe - Isometric Projection
Post by: Scipi on May 02, 2012, 01:22:32 pm
This is impressive! It's inspiring me to write my own Isometric Engine in C++ :P