id like some math in order to project a traditional x,y graph into a 2:1 isometric-like grid like below.
anybody know of some simple ways to do this. some math would be awesome
Edited by the Author.
Edited by the Author.
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
6th January, 2008 at 21:29:06 -
Actually, true isometric is some weird angle that comes close to (2 horizontal, 1 vertical), but isn't quite that.
Anyway, I'm not sure if image manipulation like that is even possible, you will probably need isometric versions of your graphics instead.
there has to be some way to project a standard coordinate system onto a system like an isometric one. ive been messing around with some stuff but none of it works right.
i will be using isometric pixel art i just need a mathematical way to place them onto an isometric like grid from say, an array. which is x, y.
yes mashedpotatoe. thats true isometric or axonometric. im not interested in that. i dont want to mess with the trig and matrice multiplication. i have some math that draws it now but it draws from the wrong side. im still working on it but i still may need some help.
well i figured out a way anywho. working on an engine debugging it. trying to implement 3dimensions.
the current method i have is different then the pic a few posts back suggests. it draws from the back farthest from the screen towards the screen but the coordinates for the grid are opposite. i got it to where x and y come out of the screen instead of going into it. i'm amazed at how simple it actually is lol.
using a nested loop to run through each x and y
loop y from 1 to (however high the array is) by +1
loop x from 1 to (however wide the array is) by +1
heres the c++ for it. the above was as easy as i could describe it in more plin english.
for(int y = 1; y <= playHeight; y++)
{
for(int x = 1; x <= playWidth; x++)
{
draw_sprite(buffer, iso, playX + tileStretch*(y - x), playY + tileStretch*(x + y) / 2);
}
}
thats the lines that draws the the basic land from a normal x, y array and projects them in an isometric like pattern on the screen. theres a lot more for movement, collisions, objects.
edit - and i got it to work in tgf but using the fastloops fail misrebly. after the size of the array gets bigger than 24x24 it starts to not draw some it. and using counters is slow as hell which would make a game using this method in tgf have long ass load times . i dont have mmf or tgf2 or mmf2 so it could work very well under those. but this is so far turning out to be a fantastic engine for isometric style games.
lol. i saw your project awhile back and i was blown away. mine is still very simple, but i hope to just keep fiddling with it until i get something i want. i've recoded it a few times already. just optimizing the mapreading and rendering of the isometric plane. i havent really made any improvements on actual turning it into a proper engine yet.
i've actually already used the directx sdk, SDL, allegro, and allegroGL. but allegro is just the one i use predominantly. too much school work to really learn and use it all.