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

ClippingPlaneCollection bug #8181

Closed
simonasdmd opened this issue Sep 19, 2019 · 24 comments
Closed

ClippingPlaneCollection bug #8181

simonasdmd opened this issue Sep 19, 2019 · 24 comments

Comments

@simonasdmd
Copy link

Sandcastle example:
Why does the same data use ClippingPlaneCollection produce different results? I want to know the difference between two pieces of data that can be loaded successfully. Tell me whether it's the b3dm file or tileset. json.
test1:
image
test2:
image

Browser:chrome

Operating System:windows 10

datas:
test1.zip

test2.zip

@OmarShehata
Copy link
Contributor

@simonasdmd thanks for uploading your sample data. Can you please provide a Sandcastle example we can run that has the clipping plane set up to reproduce this?

From the screenshots you posted it looks like the clipping plane is behaving the same way in both of them, but that the attached plane entity doesn't match up with that's being clipped in the first case, potentially due to #6573, which you can confirm by turning off the logarithmic depth buffer option on the scene.

@simonasdmd
Copy link
Author

image

I replaced the data on the case. But the test2 data is normal. Tes1 data exception. Please help me see why. Also, what you said about using "scene. logarithmic DepthBuffer = false;" doesn't work. Is there any other way? Thank you very much

@OmarShehata
Copy link
Contributor

Can you please provide a Sandcastle example we can run that has the clipping plane set up to reproduce this? You can click the "share" button in Sandcastle and paste the link here.

@simonasdmd
Copy link
Author

Well. But maybe it's because of the network problem (I'm in China). Clicking "share" may not work. I clicked "save" to produce an HTML file.
I just changed here:
image

My directory structure:
image

html file:
3D Tiles Clipping Planes.zip

share:
http://localhost:8080/Apps/Sandcastle/index.html#c=7Rn7U9s4+l/R9WY2ztUohEe3l0DvgLJTZrYLV9J2dkqno8Qi0WJbXkkOZHf43/fTw7LsOBSuvd+OacGWPn3vlz4PBugoSRBBs5QVBcvnqEhJTmNYMQ9oTnlGlVghxZFc8FukFhQJWggqaa6IYjxH/FqvXuWDgT+dJ2jGcyV4ag5kZJ4zVSbUwTrkCZOK5DOKbplaWEB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KnkpZtTkyCOpJwlJ9HL/xV41iPZnehgP4B8YWA0HVdP4m+R5r5rJ6vGzmT4/isjwxd7OsKLCqll1g9alGRC/JooMGpfCgR9t10/ndUbp5M4oaRN2sykdkSMm3NMXeMTzdNozJguv9VYrfugz0YnAfpswTmdvCsz0ftLkAb2gw9Ly4UYHnIPH6jqQ8FlpJigQ3KepGaYcr0BHPQfS05ScPm9yPrsB/7PZJ/JVswuE6LvOseOjBo0r0laA9ilg4nwqqVjq0hue6q1P7nt9LMupnAk2DXobCMsPJC3DMYzWWu36+v5YAaHDw8PW+L+RC7v1bsICgdXow8iGm5E1HPYpOHc24wwdOUzSJnJdytW+4OH8fIRM+ZJWn4uC2Znz5eZVK8h7T7tuDfdNX7b/EkPHs7+NX+7s91uitySzXWYVPmFGeqr3PDBM6XajZcOHOoaXTjnNGcIj5jsa7zcIst6fPoZ/02D5ftdxETa2PjpaFT885J/Hnm9/J3BB5um1ugBB9aD2CFpL3/JtGMhZSK9dB935zS0c74Y9bj31Cwfypog9i58dSNAefWVB/82yggulG7zIFBjILZBD5WBaQnel8EzKioW/VykzMLeu+XOhTTxCYj4l0d4O9PXuPzh4GIWFnvnk8xHaK+6C5SkXCRVb9tYcbt63yDI9ZW/0adBpMGhDt0gKlXgErWeSpHSd4pbixQjtNKhWW1OuFM/C3TZZ08vThtTXPFdbt2ZioscMafC542BQafcgYUvEksOrZ61v2lfPwMeIlLBzXaamSb569upgAPCNYzr+gcVzEDMlKw2yGL762S5ijA8G8Lp+yrEN4JanA/uNAUEPRrZ0VQQYXmiXBWWHX4tjGxOjji/Ehj2Lp8JqjaFgUwu4oLObKb8DyQwOLZnu7uA9JGvAKHjKA7nIcWF7xhHqGTo9YADpZFIPAJfm1COZ0X3kJl7W08lmFiyAOYKkPaMtbk1wlf8F

@simonasdmd
Copy link
Author

I came up with a way. You click here.
image

Then put test1 and test2 in the corresponding directory. Then replace the url. That's all right.
image
image

Just in case. I copied the code of js. You can use it.
jscode.txt

@OmarShehata
Copy link
Contributor

Thanks for sharing the Sandcastle @simonasdmd. The links work fine for me.

I think the issue here is that the model itself is offset from the center inside the b3dm. You can see in this simpler Sandcastle link that the clipping plane need a distance of about -2276 to start having an effect.

So you would either need to offset the vertices of the model when creating your b3dm, or account for this offset by shifting the clipping plane's model matrix (or just adding this additional distance when using your clipping plane).

I'm closing this since I don't think it's a CesiumJS bug, but feel free to follow up here if you're still having trouble.

@simonasdmd
Copy link
Author

hi~
But I see that the bounding boxes are calculated correctly. Is there anything else at the center?
My data is generated with "obj23dtiles". Do you know this?

@simonasdmd
Copy link
Author

@OmarShehata This question is very important to me. Can you help me?

@OmarShehata
Copy link
Contributor

@simonasdmd can you try uploading your model to Cesium ion and convert to 3D Tiles that way? This will verify whether the issue is with the offset in the geometry coordinates.

@simonasdmd
Copy link
Author

@OmarShehata @shunter
Hello. It's normal for me to slice in the XY direction. But there is a part of the error in the Z direction. I tried many ways. Want to know what attributes the planer reads. Where can I see it? Maybe it's a calculation error (but there's no problem with the central point of the bounding box). I'm very troubled now.
image
image

I will attach my obj file and my 3dtiles file.
objfile:
test_99.zip
3dtilesfile:
Batchedtest_99.zip

@OmarShehata
Copy link
Contributor

@simonasdmd is this a different version from the earlier tileset? What changed?

Have you tried uploading the source data on Cesium ion to see if the clipping planes work correctly for that?

@simonasdmd
Copy link
Author

@OmarShehata
Previous data is a bridge head. So there's an error in the XY direction. This time it's the center of the bridge, so the error from the XY direction is gone. The main error is Z direction. I don't know how cesium judges cutting. I downloaded the latest cesium-master. This problem still exists.

I am in China and I see you in France. We have six hours'jet lag, which makes it difficult for us to communicate synchronously. You can process data in your way. Is the problem still there?

Source data (objfile) has been provided.
Source data:
test_99.zip
The data I converted:
Batchedtest_99.zip

In my opinion. The bounding box's scope and center point are correct and should not have this problem, because it has described the scope of a model.

I think there are several directions to confirm now:

  1. Same obj data. Will you have the same problem after you deal with it? (Determine the computational problems in the transformation process and the attributes of the corresponding computations)

  2. Can you fix this problem by setting the settings for cesium loading?

I hope we can work together to solve this problem. As far as I know, many people have encountered this problem.

Plant trees for the benefit of posterity.

Thank you again for your help, my international friend. Thank you.

@OmarShehata
Copy link
Contributor

@simonasdmd I think I can reproduce what you're seeing with clipping on the Z axis in this Sandcastle. Clipping on X or Y, distance = 0 cuts through the center of the model. On Z, it seems the 0 is at the bottom of the model, whereas I would expect it to be through the center.

I will investigate a bit to see where this unexpected height difference may be coming from.

@simonasdmd
Copy link
Author

@OmarShehata
Thank you. I will try as many methods as I can. I hope we can solve this problem as soon as possible. Make cesium better.
My friend if you travel to China. I think I can invite you to eat some food with Chinese characteristics. (I am in Xi'an, China)

@simonasdmd
Copy link
Author

@OmarShehata
hi~
I tried some methods. But it did not solve the problem. Are you making progress?

@simonasdmd
Copy link
Author

@OmarShehata
hello~
Have you made any progress? Can you share it with me?

@simonasdmd
Copy link
Author

@OmarShehata
Have I been forgotten?....emm.....

@OmarShehata
Copy link
Contributor

@simonasdmd I'm still planning on taking a look hopefully sometime this week.

@simonasdmd
Copy link
Author

@OmarShehata Hello, is there any progress?I still can't solve this problem

@simonasdmd
Copy link
Author

@OmarShehata hi...

@simonasdmd
Copy link
Author

@OmarShehata This problem is too difficult. You can't solve the problem?

@mramato
Copy link
Contributor

mramato commented Nov 6, 2019

@OmarShehata should this be re-opened or not, you mentioned you would look into it but never followed up.

@simonasdmd
Copy link
Author

@mramato Hello, sir. Can you help me with this?I tried a lot and it didn't work out.

@OmarShehata
Copy link
Contributor

Confirmed this is a duplicate of #8053 and opened a fix here #8392

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

No branches or pull requests

3 participants