Rotating objects does not align?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
User avatar
DreadKatak
Kobold
Posts: 12
Joined: Wed Aug 02, 2017 2:58 am
Location: Santa Clara, CA

Re: Rotating objects does not align?

Post by DreadKatak »

Just bugging again on this one. Hoping that one of the almighty deities may be able to take a crack at the math that Azhrei mentioned that may be causing this. Whatever is causing this may be linked in with other display inconsistencies.

Hoping for a fix some day, but I understand that there's other more pressing stuff like new features ;)

taustinoc
Dragon
Posts: 516
Joined: Mon Aug 03, 2015 6:30 pm

Re: Rotating objects does not align?

Post by taustinoc »

Is it possible that there's a different number of transparent pixels above and below the actual image? If it were different by one, I could see something like this.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Rotating objects does not align?

Post by aliasmask »

If I recall, the difference is like 1/2 a pixel when rotated so changing the image size doesn't seem to help. What you can try is flipping the image rather than rotating it.

User avatar
DreadKatak
Kobold
Posts: 12
Joined: Wed Aug 02, 2017 2:58 am
Location: Santa Clara, CA

Re: Rotating objects does not align?

Post by DreadKatak »

aliasmask wrote:If I recall, the difference is like 1/2 a pixel when rotated so changing the image size doesn't seem to help. What you can try is flipping the image rather than rotating it.
I would love to flip it, as you are right, this doesn't exhibit the same problem, but unfortunately the door opening macros rely on rotation.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Rotating objects does not align?

Post by aliasmask »

This is what I'm talking about. The door is the same image. Top is normal door and rotated door. Bottom is normal door and flipped door.
Attachments
door alignment example.jpg
door alignment example.jpg (23.04 KiB) Viewed 577 times

taustinoc
Dragon
Posts: 516
Joined: Mon Aug 03, 2015 6:30 pm

Re: Rotating objects does not align?

Post by taustinoc »

That looks like it's off a full pixel. Can you count the transparent pixels above and below the visible image?

User avatar
DreadKatak
Kobold
Posts: 12
Joined: Wed Aug 02, 2017 2:58 am
Location: Santa Clara, CA

Re: Rotating objects does not align?

Post by DreadKatak »

taustinoc wrote:That looks like it's off a full pixel. Can you count the transparent pixels above and below the visible image?
I not sure that I understand the question. There is nothing wrong with the image itself, as identified earlier in the thread.

The magic pixel alignment issue varies with zoom, as well. The closer you are zoomed in, the harder it is to notice.

aliasmask, do you know if anyone has made door macros that use flipping instead of rotation?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Rotating objects does not align?

Post by aliasmask »

Okay, bad example. But I have seen what the OP is talking about. It could be based on the original image size and the grid scaling. After "fixing" the original image, it lined up nicely with rotation and flipping.

Afaik, you can only flip an image manually. I'm not sure how BoT does his doors (do you use standard doors or can you use your own). But if you place your door down, copy it, flip it then set up the BoT there should be no difference in how it functions unless the BoT assumes the double door has a mirror facing.

User avatar
DreadKatak
Kobold
Posts: 12
Joined: Wed Aug 02, 2017 2:58 am
Location: Santa Clara, CA

Re: Rotating objects does not align?

Post by DreadKatak »

That would be awesome if I can just fix the images (I have no problem making my own doors). Any hints on how to do this? Like appropriate sizing, etc?

User avatar
Oryan77
Dragon
Posts: 452
Joined: Sun Feb 20, 2011 3:14 pm

Re: Rotating objects does not align?

Post by Oryan77 »

Heh, glad to see this issue being brought back up. I'm a stickler for my visuals being accurate and all of these years later I still hate looking at my uneven doors.

This issue has absolutely nothing to do with the graphics. Trust me on that. I'm a graphic artist and I inspected my door graphics down to the pixel. Even testing even/odd pixel placements. It can't be an image issue or else I would also be experiencing this issue within Photoshop.

I've tested every possible way to align the double doors and have it work properly with the BoT. It's not an issue with the BoT. The BoT just requires doors to rotate in a particular direction. Seems like a pretty standard function and nothing should be wrong with that requirement.

It's a MT display issue. Either with zooming, or the placement of images within a grid. I have no idea.

For example, "flipping" an image should have absolutely no bearing on alignment. The graphic is already exactly the same. We should be able to rotate, flip, swing, toss it over a few times, smash it with a fist, and twirl it around like a fidget spinner. The graphic should still align up perfect regardless of how far in or out we are zoomed.

Simply flipping it was not a solution. I have 50 or so door graphics. Some doors have spikes on one side, most doors have hinges on one side. Lots of doors have a single handle on one side. some doors have a window frame on one side. Some doors have a head carving protruding from the outside. Flipping the graphic won't work if I use any of these doors.

Also, if I remember correctly, there was still a more technical issue with simply flipping a graphic and it not working correctly with BoT. I'm pretty sure I considered not using graphics with different visuals on each side of the door and it still did not work. I even made separate graphics for each side of a double door so that it would not need to be flipped (it would already be flipped) and MT still shifts the alignment. MT is not shifting it by an equal pixel. I think someone mentioned it is half a pixel, but even then, the more you zoom out the worse it looks. So I don't even think it is a pixel related issue at all (half a pixel or not).

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Rotating objects does not align?

Post by Phergus »

I'm not convinced there is an issue here that isn't related to the door images themselves. I suspect that it may be related to images that are created at one scale (e.g. 100 px/grid) but being used at another (e.g. 50 px/grid). It may be a resizing issue as scaling larger images down to the correct size for the map may result in a 100 pixel image being resized to 51 pixels or 49 pixels since the resize is done manually. I haven't checked that however.

I did make several "door" images to test with and they all worked as expected with no mis-alignments caused by rotation. These were all created at a 50 px grid size.

This screenshot shows the 6 different door images on a 50 pixel grid. Each door has as its GM name the dimensions and door "width". So 100x6x6 indicates 100 pixels wide, 6 pixels high and the door pixels are 6 pixels. In each case a door image was placed and then a copy was made. The copy was place next to and the images were aligned top and bottom. The right door image was then rotated 180 degrees. All but #6 are aligned correctly and, given the "size" of the door within the overall PNG, it should be obvious why that image does not align correctly.
Screenshot - No Snap
Screenshot 2017-11-16 14.21.08.png
Screenshot 2017-11-16 14.21.08.png (29.67 KiB) Viewed 490 times
The second screenshot shows the same doors but now with snap-to-grid turned on. Door #1 is no longer next to its counterpart but that is to be expected with a image that is 98 pixels wide and snapped to a 50 pixel grid. Door #6 shows the same issue as is expected.
Screenshot - Snap 2 Grid
Screenshot 2017-11-16 15.08.57.png
Screenshot 2017-11-16 15.08.57.png (29.74 KiB) Viewed 490 times
Exported maps from MT 1.4.0.5 if anyone wants to see for themselves.
Door Test 1.rpmap
A test map with 6 door images.
(8.28 KiB) Downloaded 15 times
Door Test 2.rpmap
A test map with 6 door images. Snap-2-Grid enabled.
(8.17 KiB) Downloaded 18 times
There was some mention of taking a door, rotating it and then flipping vertically to get the mirroring correct but you don't need to do that. Just flip it horizontally first and you're done.

User avatar
DreadKatak
Kobold
Posts: 12
Joined: Wed Aug 02, 2017 2:58 am
Location: Santa Clara, CA

Re: Rotating objects does not align?

Post by DreadKatak »

@Phergus

Unfortunately, your examples do not follow normal guidelines for door macros, which is why they appear to align properly in some cases.

As far as I know, typical doors use a Large token size so that they can line up properly on a standard 5' scale. If I use your example objects in the same way, I can reproduce the issue.

User avatar
Oryan77
Dragon
Posts: 452
Joined: Sun Feb 20, 2011 3:14 pm

Re: Rotating objects does not align?

Post by Oryan77 »

Phergus wrote:I'm not convinced there is an issue here that isn't related to the door images themselves. I suspect that it may be related to images that are created at one scale (e.g. 100 px/grid) but being used at another (e.g. 50 px/grid).
I downloaded your map to take a look at this. It's been years since I messed with this issue.

I believe I just found the culprit! Or maybe I should say you found it and I've found out what my issue was?

I compared your examples to the door graphics I've been using. Mine are sized similar to your DoorTest4 graphics. Yours is 100x50 pixels while mine were sized 400x100 pixels.

Normally, I would think that this is fine and will rotate and align correctly (which it does). The BoT requires the doors to be sized as squares in order to work properly. Ok, so to get a 100x50 (or 400x100) pixel graphic turned into a square, I just change the size of the object within MT from "free size" to medium, large, huge, etc, etc. Wallah, it is now "squared".

That's the issue. Since the original graphic is 100x50 rather than 100x100 (squared), MT adjusts the placement of the resized graphic just enough where it looks misaligned. I don't understand why it looks worse or better when you zoom in and out, but I assume it has to do with the zoom feature in MT? MT isn't actually changing the pixels in a resized object, so it struggles handling the difference during zooming? Maybe related to how text boxes stay the same size regardless of how much you zoom in or out?

If the original graphic is squared (100x100), then MT doesn't need to worry about the pixels when you change the size of the object and it works normally as an animated double door.

I must have never created original "squared" graphics before testing them in MT. It's possible that I thought the resized doors in MT were originally squared when they were actually sized to medium or large.

Can someone verify this for me so I know I'm not crazy?

So the solution is to create a squared version of the graphic before importing them into Maptool? The canvas or bounding box must be squared with the graphic aligned properly within that area. Don't just change the size of the object within MT to medium or large in order to make them squared like some numbskulls apparently do.

User avatar
Oryan77
Dragon
Posts: 452
Joined: Sun Feb 20, 2011 3:14 pm

Re: Rotating objects does not align?

Post by Oryan77 »

DreadKatak wrote:@Phergus

Unfortunately, your examples do not follow normal guidelines for door macros, which is why they appear to align properly in some cases.
No, I thought this was the case at first also. But I got doors 5 and 6 to animate and align correctly. They are objects set at "free size", so their square shape comes from them being 100x100 pixel png files. You can still resize those objects within MT to large, medium, etc, etc, and they still align correctly because their original image is squared (100x100). The other images are not originally squared graphics (100x50 px, 100x5 px, 100x6px). They must be squared to animate, so you have to resize them within MT to medium, large, etc, etc. That's the issue. That is why they won't align. Doors 1, 2, 3, and 4 are not originally squared and they are not aligned for me when animating (as expected).

Edit those graphics in Photoshop and size them each to be 100x100 (squared) and import them back into MT and they will align correctly even if you still resized them within MT.

I think the problem has been solved. :shock: It may not be possible to "fix" the resizing issue when sizing the objects in MT. MT isn't actually manipulating the pixels when it resizes, which is why it looks funky when zooming.

User avatar
DreadKatak
Kobold
Posts: 12
Joined: Wed Aug 02, 2017 2:58 am
Location: Santa Clara, CA

Re: Rotating objects does not align?

Post by DreadKatak »

Oryan77 wrote:
DreadKatak wrote:@Phergus

Unfortunately, your examples do not follow normal guidelines for door macros, which is why they appear to align properly in some cases.
No, I thought this was the case at first also. But I got doors 5 and 6 to animate and align correctly. They are objects set at "free size", so their square shape comes from them being 100x100 pixel png files. You can still resize those objects within MT to large, medium, etc, etc, and they still align correctly because their original image is squared (100x100). The other images are not originally squared graphics (100x50 px, 100x5 px, 100x6px). They must be squared to animate, so you have to resize them within MT to medium, large, etc, etc. That's the issue. That is why they won't align. Doors 1, 2, 3, and 4 are not originally squared and they are not aligned for me when animating (as expected).

Edit those graphics in Photoshop and size them each to be 100x100 (squared) and import them back into MT and they will align correctly even if you still resized them within MT.

I think the problem has been solved. :shock: It may not be possible to "fix" the resizing issue when sizing the objects in MT. MT isn't actually manipulating the pixels when it resizes, which is why it looks funky when zooming.
Awesome! I'll give it a try now! I am glad you came back to check on this. It annoyed the hell out of me as well!

Post Reply

Return to “MapTool”