GLBasic forum

Main forum => Beta Tests => Topic started by: Wampus on 2012-May-25

Title: Isometric look - can be freely rotated
Post by: Wampus on 2012-May-25
Isometric look pseudo 3D 'engine'

(http://i904.photobucket.com/albums/ac242/wheeethefibble/webpics/isometric.jpg)

You can download the example app here: http://www.mediafire.com/file/sr8z51bbwe8d96f/isometricdemo.app.zip (http://www.mediafire.com/file/sr8z51bbwe8d96f/isometricdemo.app.zip)

Left click and hold while moving the mouse to adjust view. Right click and hold while moving the mouse to rotate the view. Use the mouse wheel to zoom in or out.

I wrote this last night for fun after I had the idea about how it could be done. The whole scene is rendered with polyvectors and a little trigonometry math. Surfaces aren't drawn if they're covered up by other surfaces.

Since I can't think of anything to use it for that couldn't be done better in normal 3D or rendered isometric look bitmaps I probably won't ever use this for anything or develop it further. If anyone can think of a good use for this kind of look please let me know. :)
Title: Re: Isometric look - can be freely rotated
Post by: MrTAToad on 2012-May-25
Its rather good - and could be quicker than using 3D on devices like the Android.   Any chance of releasing the source code ?
Title: Re: Isometric look - can be freely rotated
Post by: Albert on 2012-May-25
Source code please!

Tapatalk 2-vel küldve az én GT-I9000-ről
Title: Re: Isometric look - can be freely rotated
Post by: mentalthink on 2012-May-25
Wampus how make the isometric camera... I have troubles whit the ortho command of OpenGL... always I have an error like @24XXX or something like this... I read something about this you have to add a link to the compilder... but not works for me...

Good work!!!, the Isometric view , it´s very nice for some games, and very useful in applications...

I hope you release the code  :nw: :nw: :nw: :nw:
Title: Re: Isometric look - can be freely rotated
Post by: Wampus on 2012-May-25
mentalthink I skipped using OpenGL and did the calculations in code instead. Since you and others have asked I'll upload the code into the snippets section once I've finished a business call.

Be aware that the code was done in a rush. There isn't much notation, there are a few duplicitous or unnecessary calculations and the zooming and rotating control is currently a hack rather than true zooming and rotation. There are also many things it doesn't do. For example, there is no function to translate screen co-ordinates to world co-ordinates. Still, I hope someone finds it useful.
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-May-25
Gasp! Amazing! And it moves smoothly with no glitches or anything, just perfect!
Such engine has a lot of potential, congratulations.
Title: Re: Isometric look - can be freely rotated
Post by: Slydog on 2012-May-25
Incredible!   :good:
It is very smooth!

How did you do the shading when a face rotates away from the 'camera'?
Did you just apply a shading factor based on how directly the face is towards the camera, then pass that factor to the polyvector command (using the colour parameter)?
Title: Re: Isometric look - can be freely rotated
Post by: Wampus on 2012-May-25
Ok the code has been uploaded. The end result might look nice but really, the code was a rush job.  :-[ Here is the link: http://www.glbasic.com/forum/index.php?topic=8152.0 (http://www.glbasic.com/forum/index.php?topic=8152.0)

Incredible!   :good:
It is very smooth!

How did you do the shading when a face rotates away from the 'camera'?
Did you just apply a shading factor based on how directly the face is towards the camera, then pass that factor to the polyvector command (using the colour parameter)?

Yes, that's what it does. Depending on the angle it will pass darker or lighter colours to the polyvector command.

There is a quality variable. If you set it to 0 instead of 1 you can see what it looks like without shading. Not very good, basically. Hard to tell what's happening.
Title: Re: Isometric look - can be freely rotated
Post by: Ian Price on 2012-May-25
That's really great and mirrors something that I was considering working on in the future (a Final Fantasy Tactics/Onimusha Tactics type TBS game).

Lovely :)
Title: Re: Isometric look - can be freely rotated
Post by: r0ber7 on 2012-May-25
Are those Minecraft textures?  ;)
Title: Re: Isometric look - can be freely rotated
Post by: theprotocol on 2012-May-26
This is extremely cool! Well done, Wampus.

How did you get the idea to do this?
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-May-26
That's really great and mirrors something that I was considering working on in the future (a Final Fantasy Tactics/Onimusha Tactics type TBS game).

Yep, we need more tatical games, I´m quite a fan of both (and ogre battle too).
But you could also have an adventure going, like cadaver, or maybe something more rts like powermonger.
Title: Re: Isometric look - can be freely rotated
Post by: Ian Price on 2012-May-26
I nearly added Ogre Battle and Disgaea but didn't want to weigh the post down too much...
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-May-27
you should have :whip:
I never heard of Disgaea, now I will have to scavenge about it since I love tatical games! Thanks :good:
Title: Re: Isometric look - can be freely rotated
Post by: Ian Price on 2012-May-27
Disgaea is/are one of the best 3D TBS games available. It's available on DS, PSP, PS2 and PS3 in various guises and ports. They are wonderfully inventive, with super silly attacks that'll have you laughing your socks off.
Title: Re: Isometric look - can be freely rotated
Post by: Wampus on 2012-May-27
This is extremely cool! Well done, Wampus.

How did you get the idea to do this?

Well, its very nerdy, so be warned. I was out on a short walk and got to thinking about affine texture mapping problems (http://en.wikipedia.org/wiki/Texture_mapping). I mused that isometric texture mapping wouldn't have the problems that 3D texture mapping has without perspective correction. I realised it would also be possible to calculate perspective correction for all blocks and other objects in an isometric scene with a few trig functions. A kind of z-buffering for isometric view could be taken care of by separating render order into quadrants determined by the angle of rotation. When I got home I scribbled some notes, created a rotating block then created the example I posted here.

I was going to leave it at that since 3D hardware is so powerful nowadays. Why would anyone bother with isometric? Now I'm thinking 1) It has retro appeal and 2) It has a charm of its own. So, I will probably use it to make some kind of game soon.

Oh, and r0ber7 I have no idea what you mean. Everything I do is totally original.  :-[ Seriously though, I will be creating a new bigger scene myself today with my own textures. It would look nice on YouTube.
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-May-28
I would not call that nerdy, but a "professional technical/scientific take on a know set of problem".
Heck, Wampus, such a thing as a MFa or Msc or even PHD on the subject holds enough power.
Congratulations, it is wonderful to see the base and reasons for striving for a solution! :good: :good:
Title: Re: Isometric look - can be freely rotated
Post by: theprotocol on 2012-May-29
This is extremely cool! Well done, Wampus.

How did you get the idea to do this?

Well, its very nerdy, so be warned. I was out on a short walk and got to thinking about affine texture mapping problems (http://en.wikipedia.org/wiki/Texture_mapping). I mused that isometric texture mapping wouldn't have the problems that 3D texture mapping has without perspective correction. I realised it would also be possible to calculate perspective correction for all blocks and other objects in an isometric scene with a few trig functions. A kind of z-buffering for isometric view could be taken care of by separating render order into quadrants determined by the angle of rotation. When I got home I scribbled some notes, created a rotating block then created the example I posted here.

I was going to leave it at that since 3D hardware is so powerful nowadays. Why would anyone bother with isometric? Now I'm thinking 1) It has retro appeal and 2) It has a charm of its own. So, I will probably use it to make some kind of game soon.

Oh, and r0ber7 I have no idea what you mean. Everything I do is totally original.  :-[ Seriously though, I will be creating a new bigger scene myself today with my own textures. It would look nice on YouTube.

Great! I always love hearing stories about things like this.

It may be nerdy but I wish I was that knowledgeable. The way they taught us programming in college was very "light" and there was more of an emphasis on high level concepts, so I'm fascinated by stuff like this (Incidentally, I'm trying to learn more and more low-level stuff nowadays).
Title: Re: Isometric look - can be freely rotated
Post by: cruelcynic on 2012-Jun-03
That is awesome. How does it look with character sprites on it? That would make for a great shining force game.
Title: Re: Isometric look - can be freely rotated
Post by: Wampus on 2012-Jun-04
That is awesome. How does it look with character sprites on it? That would make for a great shining force game.

It looks good enough. Nicer with drop shadows underneath, which are kind of important for sense of depth and height.
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-Jun-04
I wondered on the sprite thing too, like on the FF tatics, sprites are not 3d but have the usual 4 positions (more like 2 + 2 flipped).
The whole light direction could make it strange, but having sprites on the ´Top to down´ style does an ok job on FF tatics.
Same could be done here, but I guess we could do even better :P
Title: Re: Isometric look - can be freely rotated
Post by: Wampus on 2012-Jun-04
8 directions would look a lot nicer. I've only experimented with X_SPRITE style billboarding so far.
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-Jun-12
This kind of game here could also take advantage of the engine :good:

http://theinstructionlimit.com/diluvium-tojam-7
Title: Re: Isometric look - can be freely rotated
Post by: Hatonastick on 2012-Jul-04
Wow.. I'm impressed.  That runs extremely smoothly and looks good as well!  I hope you are going to expand that a bit more. :)

Without giving us your source, I'd like to see a tutorial that explains how you went about this.  Haven't done my own 3D calculations since my Atari ST days.  Can't even remember how to go about it anymore...
Title: Re: Isometric look - can be freely rotated
Post by: erico on 2012-Jul-04
code + notes is here:
http://www.glbasic.com/forum/index.php?topic=8152.0
Title: Re: Isometric look - can be freely rotated
Post by: Hatonastick on 2012-Jul-04
Awesome, thanks!  BTW I noticed you mentioned Voxels in that topic.  Voxels is what I was thinking of too for some reason.  I'd love to write a voxel engine one day.

Edit:  You've done some prodding of my mind today with your posts.  I'm also currently looking up/trying to research Ambient Occular shaders because of something you said in another thread.  For some procedurally generated non-textured 3D for a game I'm working on.