• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Need help in getting answer to this Formula???

Started by Pat, January 26, 2008, 03:38:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pat

I need some math help with a project that is being done - my maths seems to have deserted me 

I am trying to determine a formula to work out a snap to grid system for this project. I'm working at zoom 3 in SC4, giving me a 1x1 tile that is 22 pixels wide by 14 pixels high. The problem lies in the fact that the othographic projection in SC4 is at 32.5 degrees which means that there is no simple gridding system and it's going to have to be mathematical, and I just can't get my tired out brain cells around it. I need a formula that says:

if x is at such and such and y is at such and such then the nearest grid snap point is at x1 and y1.

I'm sure in the fullness of time I could work it out, but the brain is crying out STOP!!!!

Any help would be greatly appreciated,

Don't forget the SC4D Podcast is back and live on Saturdays @ 12 noon CST!! -- The Podcast soon to Return Here Linkie

jplumbley

Quote from: Pat on January 26, 2008, 03:38:34 PM
I need some math help with a project that is being done - my maths seems to have deserted me 

I am trying to determine a formula to work out a snap to grid system for this project. I'm working at zoom 3 in SC4, giving me a 1x1 tile that is 22 pixels wide by 14 pixels high. The problem lies in the fact that the othographic projection in SC4 is at 32.5 degrees which means that there is no simple gridding system and it's going to have to be mathematical, and I just can't get my tired out brain cells around it. I need a formula that says:

if x is at such and such and y is at such and such then the nearest grid snap point is at x1 and y1.

I'm sure in the fullness of time I could work it out, but the brain is crying out STOP!!!!

Any help would be greatly appreciated,

Im not sure what you are asking for here bud...  Are you talking about creating a BAT?  If so the best way I would suggest is BAT the model with no rotation and then rotate it 32.5 degrees before rendering it..
"You learn something new everyday."

http://img517.imageshack.us/img517/169/nhpjplumbleykv3.gif
Bringing the new horizons closer to reality.

Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio jplumbley ♦ moganite ♦ M4346 ♦ Dedgren ♦ Ennedi Shadow Assassin ♦  Tarkus ♦ wouanagaine
Street Addon Mod - SAM

RebaLynnTS

#2
x1 = Int((x/22)+.5)*22
y1 = Int((y/14)+.5)*14
Becca

Look for me at ... Becca At Bat

Pat

ty Becca.... Jp what is trying to be done is not a bat but sorta like a simulation  ;)

Don't forget the SC4D Podcast is back and live on Saturdays @ 12 noon CST!! -- The Podcast soon to Return Here Linkie

jplumbley

Quote from: Pat on January 26, 2008, 10:47:59 PM
ty Becca.... Jp what is trying to be done is not a bat but sorta like a simulation  ;)

I like simulators... I get interested about simulators...
"You learn something new everyday."

http://img517.imageshack.us/img517/169/nhpjplumbleykv3.gif
Bringing the new horizons closer to reality.

Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio jplumbley ♦ moganite ♦ M4346 ♦ Dedgren ♦ Ennedi Shadow Assassin ♦  Tarkus ♦ wouanagaine
Street Addon Mod - SAM

JoeST

mmmmmmm simulation.... any more than that Pat?
Copperminds and Cuddleswarms

RebaLynnTS

PAt, you are very welcome. I have used that formula quite often, writing windows programs.
Becca

Look for me at ... Becca At Bat

Pat

JP, Joe, and Becca: Thank you all and yes if you would like to know more about what the SIMulator is about just check in on at SimCities and if you all would like to help out some more just drop Mike a PM about it and I think he might and would love the help as he is starting to look like sooo..........


Don't forget the SC4D Podcast is back and live on Saturdays @ 12 noon CST!! -- The Podcast soon to Return Here Linkie

wouanagaine

so here will be my 0.02€ for that, SC4 angle is "around" 32.5°, and "around" depend on the zoom level


New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4