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 Professional Discussion / Building a grid...

Author
Message
Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Jul 2010 08:28
Okay so I have this as the current boundaries drawn...



That will also give you the idea of the image I am trying to grid if you run the code. How do I build an even 2x2 grid with this inside of those boundaries?

Thanks!
Zeus

luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 1st Jul 2010 08:49
http://forum.thegamecreators.com/?m=forum_view&t=145335&b=6

See this code snippet, it may help you.It covers grid in briliant way.Not sure if it`s possible to twist it the way you need it.

What you are gonna use this for?

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Jul 2010 08:50
Placing items a certain way on the attached image. I can't twist that the way I need it, I have already tried.

Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Jul 2010 19:46
Anyone?

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 1st Jul 2010 20:40
Well... with a pseudo-3d grid, you'd need pseudo-3d sprites... It'd be easier just to use 3d transformations or actual 3d objects IMHO.

Anyways, you can use a system of parametric equations to make a parallelogram.
(x1,y1) to (x2,y2) - interpolated by xt from 0-1
(x1,y1) to (x3,y3) - interpolated by yt from 0-1
x=(x2-x1)*xt+(x3-x1)*yt + x1
y=(y2-y1)*xt+(y3-y1)*yt + y1




Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Jul 2010 21:38
Thanks NeuroFuzzy!

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Jul 2010 22:21
If you have some insight in vector math, then you should be able to use this:



Cheers!
Sven B

Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Jul 2010 23:00 Edited at: 2nd Jul 2010 17:02
My next problem is how do I retrieve the tile number using NeuroFuzzy's method?

Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 2nd Jul 2010 17:02 Edited at: 2nd Jul 2010 20:50
Nevermind.

Login to post a reply

Server time is: 2026-07-25 08:13:10
Your offset time is: 2026-07-25 08:13:10