Cannot change the classification type by polygon vertically and dynamically

Hello there,

My ultimate goal is to change the classification color on the CesiumTileset object withing the selected vertical area. Just like below but it is not changed actually:

image

I want to make it like this by selecting vertical area dynamically.
image

I know polygon entity can change the classification type of the surrounded area of CesiumTileset horizontally.
However, I do not know how to do that vertically in polygon.
Extruding the polygon sounds confusing to change dynamically?
I can think of applying the box entity or like ClassificationPrimitive.
example below:

This question here has the similar objective as mine.

Best regards,
Hiroshi

Hello Hiroshi,

I don’t believe it’s possible to use a “vertical” polygon to classify a tileset. Polygons, even if extruded, will always follow the surface of the ellipsoid. The photogrammetry example you’ve linked to is using a box classification. It just appears “vertical” because of the overhang.

Like in that other thread you link to, I would recommend using a box to classify the tileset as it is the most straightforward. Would it perhaps be possible to simplify the UI to restrict the user to boxes or ellipses? A complete list of geometries available for classification are documented here.

Thanks!
Gabby

1 Like

Hello @Gabby_Getz

I appreciate your advice.
I will try the box geometry out to classify the tileset.

Also, I couldn’t access to the url you have provided.
I assumed you have sent me something like this in the gallery?

Anyway, I will give your back the result of my trials.

Best,
Hiroshi

Hello Hiroshi,

Great!

My link was to ClassificationPrimitive - Cesium Documentation. I fixed the linked in my previous comment.

Thanks!

Thanks @Gabby_Getz

I have tried your the ClassificationPrimitives and I was able to classify the point cloud with adding a color.

However, there are two issues I am facing, may I ask an advice?

  1. I also wanted to show the geometry visually so I added a appearance object then it gave me an error which does not make sense for me.
DeveloperError: Materials on ClassificationPrimitives are not supported except via GroundPrimitives
Error
    at new DeveloperError (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:7971:13)
    at ClassificationPrimitive.update (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:72004:15)
    at PrimitiveCollection.update (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:136305:21)
    at updateAndRenderPrimitives (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:197792:23)
    at executeCommandsInViewport (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:197644:5)
    at Scene4.updateAndExecuteCommands (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:197462:7)
    at render (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:198098:11)
    at tryAndCatchError (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:198112:7)
    at Scene4.render (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:198164:7)
    at CesiumWidget.render (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:208761:19)
  1. I want to align the classifier box in parallel with the plane but what kind of modelMatrix should I give to the ClassificationPrimitive.
    I might be able to do the math on my hand but it will take time and I don’t know the Cesium library well yet so I would like to ask for your support.

Thanks a lot!

Best,
Hiroshi

Hi @Marco13
I have a mathematical issue at my second question.
I was hoping if you could also give me some suggestion for it as well.
Thanks.

I had a short look at the sandcastle, but am not sure what the question is.

For the error regarding the Material: Omitting the appearance from the classification primitive avoids the error, but I don’t know what this part of the code is supposed to accomplish. I assume that you wanted to visualize the classification volume in some way.

For the “mathematical” question: In the sandcastle, something should happen. It is possible to click something. After some clicks, something happens. What happens there involves a modelMatrix. And … the question seems to indicate that the model matrix is wrong, or more specifically: What this model matrix is supposed to look like to make sure that the thing that does happen is the thing that should happen. This is not a question that can sensibly be answered.


An aside: People generally appreciate it when questions have an associated sandcastle. A sandcastle allows to quickly understand the core of the question. But this only works when the sandcastle is on point, and makes clear what the question is.

In the following Sandcastle, I removed everything from your sandcastle of which I thought that it might not be relevant (and tried to clean up the remaining part). You can click at two points on the plane. This creates a classification primitive, and a primitive for visualizing the classification volume. If there are more specific questions (e.g. regarding the model matrix), maybe they can be discussed based on this sandcastle.