#Sprite to world coordinates weirdness

1 messages · Page 1 of 1 (latest)

cedar chasm
#

Okay so. For some reason things are not lining up where they should be.

My blender setup uses a 45 degree tilted camera pointed at the subject. Between this is a 3200*3200mm plane (scale is needed to get the coords to translate properly, doesn't matter at all for this).

Using a shrinkmap modifier, I can pinpoint verticies on my 3D model, and have them "stick" onto the plane; this results in what should be a pixel-perfect projection of where that vertex is on the sprite.

But it's not. For some reason the coordinates in game do not match and I can't figure out why. Below shows the problem:

#

Fig 1: My blender setup shows these coords for the turret

#

Fig 2: Vehicle position is 0,0 in the world

#

Fig 3: Turret position set to my blender coordinates

#

Fig 4: Sanity check with my "print cursor coords" item

#

To prove that things should be lining up. I aligned a screenshot from in game to my blender scene. Kind of hard to show via pictures but the vehicle sprite is basically dead on.

#

So if my rendered sprite matches my 3D model, then my vertex positions should also.....no? If so where's this difference coming from?

cedar chasm
#

Okay I've figured out the how, but not the why.

My turret scale was set to 0.8. Multiplying my hardcoded coords by 0.8 aligns everything properly.

I have no clue why this is though, as far as I can tell entities are origined at their own center, scale shouldn't affect anything?

strange jolt
#

Entities are origined at their center, but if the sprite image's center isn't aligned with the entitiy center, that could also be the cause

#

Btw, entities usually have a scale of 0.5 and a resolution of 64 pixels per tile. You can use whatever you want, but that's the standard and can be good to follow

cedar chasm
#

Atm all my sprite are 1.0 scale bar the turret, I'll rescale everything properly for LR/HR when I've got all the "basics" done

The turret sprite should be central to its entity 0,0. Everything I can check seems to confirm this apart from this one weird issue.

I've got the rocket bays on top to do next, I'll see how they look

strange jolt
#

You shouldn't need to (and can't) specify for low resolution and high resilution separately, the game downscales sprites automatically

cedar chasm
#

Isn't the norm that LR is 1.0, and HR 0.5?

strange jolt
#

There is no concept of LR and HR at all since factorio 2.0. Its all in high resolution, and at a scale of 0.5.

cedar chasm
#

Oh apologies I'm back at 1.10

#

Probably should have started with that