Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange/incorrect sphere shapes #215

Open
scrapmech opened this issue Feb 15, 2022 · 19 comments
Open

Strange/incorrect sphere shapes #215

scrapmech opened this issue Feb 15, 2022 · 19 comments
Labels

Comments

@scrapmech
Copy link

Minecraft version: 1.18.1
MiniHUD version: 0.21.3

When using Sphere block-based generator I noticed strange behavior: generated spheres are often not symmetrical, especially when using block snap corner or none options. Adjustable spawn sphere seems to produce better results.

Attached is an example for this behavior. You can see that on the right side there are several extra blocks.

2022-02-15_20 11 05
2022-02-15_20 11 13

@maruohon
Copy link
Owner

I believe the "normal" sphere uses the distance of the block center to the center point as the deciding criteria for which blocks to consider as the edge. So if the center of the circle is not centered on a block, then I guess it's entirely possible that it will not look symmetrical because the "unsymmetrical distances" on the opposing sides of the sphere result in different blocks being selected as the edge.

@scrapmech
Copy link
Author

@maruohon The center of the sphere is exactly in the corner of a block though? The block centers of blocks that are symmetric are exactly the same distance from it. For example sphere with center at (0, 63, 0) and radius of 6. Two gold blocks whose centers are at (3.5, 66.5, 3.5) and (-3.5, 66.5, 3.5). The distance is sqrt((3.5^2)*3)=6.062177826. Left one is included in the sphere but right one is not

2022-02-16_03 17 21

@maruohon
Copy link
Owner

Yep that is certainly weird when the center is at the corner of the blocks. I haven't properly debugged this yet, but it might be a sort of directional preference in the way the code builds the "rings" by walking around the perimeter. Maybe it's not properly trying all the required sides when it comes to the points where the "outside direction vector" kinda changes. I'll need to take a proper look at it at some point soon.

@HiggsBogan
Copy link

I was building a 128 radius sphere before i updated and now it doesnt line up no matter what i do. I keep thinking maybe i stuffed it up but theres no way i made this many mistakes when you can clearly see mis-placed blocks :(
2022-03-05_06 14 38

@maruohon
Copy link
Owner

maruohon commented Mar 4, 2022

@HiggsBogan Is the center point, block snap setting and radius exactly the same as before? If you didn't use a block snap setting and you moved the center point even slightly, then it's possible that the positions changed like this. What version of the mod did you use before? If this was all in the 1.18+ versions, then I don't think I changed anything yet with the sphere stuff since the first "official" 1.18.0 release. I did rewrite some of the sphere stuff recently at one point, but I think it was leading up to the full 1.18.0 release.

I decided to leave the fixes this issue report is related to, to the bigger mod rewrites that are happening in 1.12.2, as I may need to or want to rewrite some more of how the shapes are generated, so I didn't want to delay the 1.18.2 updates further. So it's also possible that the sphere is just slightly crooked depending on the center point in relation to the block bounds (apparently). But even so it shouldn't change over time if the center and the settings remain the same.

@HiggsBogan
Copy link

HiggsBogan commented Mar 4, 2022

not too long ago I messed up and deleted the sphere i was using. once i got it back to where it should be i took a screen shot of the coords and set up. the one above maybe off a bit because i was trying to get it right. just for you i re installed what i had before and set it to the settings in the screen shot i took for reference. heres that one
2022-03-05_06 47 46

As you can see give or take the few mis placed blocks everything is fine.

Its all good :) I can wait or if i need to i will roll back when i need too. just thought id show you that its a bit wonky.

Thanks for your response

Oh also yeh I was using 0.19.0 - dev20211204.230657

@maruohon maruohon added the bug (minor) Small bug that does not majorly affect functionality label Mar 13, 2022
@Firazoid
Copy link

Firazoid commented Jul 3, 2022

Has there been any update on this bug? I am encountering the same issue. It seems to me like the misshapen side is always on the west, regardless of any combination of settings. I notice the images provided by the OP also show errors on the west side only.

As is, I consider the sphere tool to be unusable.

@Wolkenfarmer
Copy link

Wolkenfarmer commented Sep 18, 2022

Still present in 1.19.2.

@maruohon maruohon added bug and removed bug (minor) Small bug that does not majorly affect functionality labels Oct 10, 2022
@maruohon maruohon pinned this issue Jan 10, 2023
@Jescudie
Copy link

Still present in 1.20.1.

@obfuscoder
Copy link

Before creating my issue, I failed to use the search function to figure out if this was already reported. I had the same issue wiuth spheres. It does not matter what snap method is used. The sphere is always asymetrical. Cylinders shapes ARE symetrical so my guess is that the function to calculate the points on the sphere is faulty (My guess is that the floating point arythmetic is incorrect. Ssome rounding issue? Using integers where floating/fixed point values ought to be used?)..

@OldMensch
Copy link

Still an issue in 1.20.4

@Alexandre-LvLDesign
Copy link

seriouslybro
Still an issue in 1.20.4 ( 29/02/2024)

the bug is present since Feb 2022, I don't think it will be fix

@CaduceusBasilisk
Copy link

Still an issue in 1.20.4 (03/05/2024)
IMG_5848

@valve-developer
Copy link

Untitled
still present in 1.21

@sakura-ryoko
Copy link

sakura-ryoko commented Jul 9, 2024

I am aware of it, I just haven't had a chance to look at it yet (1.20.6/1.21)

@AdielHub
Copy link

I guess in the meantime the only fix is to make a cylinder with a radius of +1/-1 for each increment of y level

Very very very inconvenient but it's better than a wrong sphere

Maruohon, like, disable the sphere feature until it's fixed.
The only thing worse than not having a sphere tool is having a sphere tool that you only realise hasn't worked properly until your minecraft project is done

@Hlebuw3k
Copy link

I built something with this, unaware that it was not correct. Please disable the feature until fixed.

@Caderk
Copy link

Caderk commented Nov 11, 2024

I guess in the meantime the only fix is to make a cylinder with a radius of +1/-1 for each increment of y level

That's a cone my brother, not a sphere.

@JamesSG2
Copy link

This issue still persists in Java 1.21.4! (Latest Minihud as of 12/13/24) Clearly these are not perfect spheres even when using the sphere shape in Minihud. They also don't agree with: https://www.plotz.co.uk/plotz-model.php?model=Sphere which I know has correct dimensions. Please fix this stat! Seems like the most basic feature of Minihud doesn't work correctly:

2024-12-14_21 33 29
2024-12-14_21 43 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests