Quick Rotation question

Am I right in thinking the rotation of a piece is around a central pixel, or is it done through reflection across a bisector…??

I’m pretty sure its the first but would like to know for sure if possible…

Thanks to anyone who can help.

I’m not sure what you mean by “reflection across a bisector” but there’s 2 traits that may concern the item in question.

“Can Rotate” does rotate around a central point …like a roulette wheel.

“Can Pivot” allows you to move a piece around an established point …like nailing the corner of a piece of cardboard then pivoting the board around the nail.

Does that answer your question?

Thus spake “Dr_Nostromo”:

I know exactly what he means. Reflection has nothing to do with rotation.
There’s presently no trait for this, but it woudn’t be hard at all to
write a custom one to do it.


Messages mailing list
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thats not entirely true. But you have answered my question, so thanks a lot.

The reason for asking is that it makes a subtle difference with whether you choose image sizes with odd or even length in pixels. If you use Gimp (open source art package) to rotate it rotates round the nearest to centre pixel, as its reference point, which gives some minor distortions and displacement on say a 64by64 image…

Whereas basic MS Paint, does not and you find whatever rotation you choose (although limited really to the orthogonal for this package, if you can call it that…) it would rotate about the… er… this hard describe without a picture…

But anyway, yeh, although it isn’t actual reflection, it gives an end result that would be consistent with the end result of an image rotated through multiple reflections.

I’ll rephrase the question though…

Would you advise odd or even dimensions for images within Vassal…?? If accuracy was particularly important…

Sorry I realise I’m talking in fundamentals where it is unnecessary to do so, the mapping of pixels in an image rotation is done in mathematical terms by a point by point reflection map; but as you say, the computer doesn’t use mirrors to do it, it uses a transformation matrix of basic reflection data…

So sorry, the question is definitely on image dimensions in real terms…

Odd or even??

I realise its not so important when you use snap to grid; but with arbitrary rotations used frequently or in combinations a pixel or so margin of error can all of a sudden noticeable.

Thus spake “danjaman”:

What I said was a gloss; some reflections and some rotations can be
equivalent given the right image.

Our intention is for VASSAL to rotate pieces about their true centers, so
a piece with both dimensions even would rotate about the vertex at the
center, while a piece with both dimensions odd would rotate about the center
of the central pixel.

If you find that it doesn’t behave like this in practice, that’s a bug which
you should report.

Accuracy of what, exactly? Of the pieces’ bounding boxes? Of the pieces’
edges? centers?

This is further vexed by the fact that a piece with odd dimensions might
not have odd dimensions at some scale levels other than 1:1, so accuracy
might depend on what scale level you plan to use most.


Messages mailing list
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks that answers my question and points me to the conclusion that slight changes in position I perceive are due to the actual images position in the canvass.

So I imagine the pivot function also uses the true centre as a reference to the offset of the rotation function.

Saves me some pixel counting thanks very much :slight_smile: