Select to view content in your preferred language

Size is changing in AGSModelSceneSymbol with symbolSizeUnits set to .dips

914
5
Jump to solution
02-01-2023 03:36 AM
YoussefMAHERZI
Occasional Contributor

Hello,

When I create a AGSModelSceneSymbol with a dae file and symbolSizeUnits is set to .dips, the size of the object changes when I rotate the object (heading).

I assume you're trying to keep always the same width of the object. But when the object isn't circular and I rotate the object it's normal that the width of the displayed object changes.

I attached a sample project of a symbol with a marker. When I animate the heading, we clearly see that the object size is changing.

Best regards,

0 Kudos
1 Solution

Accepted Solutions
YoussefMAHERZI
Occasional Contributor

Using the following method :

let renderer = AGSSimpleRenderer()
renderer.sceneProperties?.headingExpression = "[HEADING]"
graphicsOverlay.renderer = renderer
....
graphic.attributes["HEADING"] = heading

Instead of just simply "symbol.heading = angle" fixed the problem.

This may need to me mentioned in the documentation.

Thank you

View solution in original post

5 Replies
YoussefMAHERZI
Occasional Contributor

Using the following method :

let renderer = AGSSimpleRenderer()
renderer.sceneProperties?.headingExpression = "[HEADING]"
graphicsOverlay.renderer = renderer
....
graphic.attributes["HEADING"] = heading

Instead of just simply "symbol.heading = angle" fixed the problem.

This may need to me mentioned in the documentation.

Thank you

DavidFeinzimer
Esri Contributor

Hi Youssef, thank you for reaching out! I've ran your sample and your proposed solution. I'll research to see if there's a simpler way and will keep you updated.

0 Kudos
YoussefMAHERZI
Occasional Contributor

Thank you very much 🙂

0 Kudos
DavidFeinzimer
Esri Contributor

Hi Youssef. I've completed my research on your question and the solution you've suggested above is the best approach to take for this problem.

Since a 3D model may have an unwanted initial orientation, the symbol's heading, pitch, and roll properties are provided as a way to customize their initial orientation. Using these properties to produce an animation is an expensive operation and can lead to unexpected results (take your issue reported here example).

Using the heading expression that you've found is the recommended way to produce an animation. I've attached a modified version of your view controller, where I've implemented the recommended approach.

I'd also like to point you to our Samples application that can be a good source of best practices. For this specific question, please refer to the Animate 3D Graphic sample.

I hope this information helps, please feel free to reply if you have any further questions!

0 Kudos
YoussefMAHERZI
Occasional Contributor

Yes indeed, I actually got the solution from that sample.

Thank you for your help and your research.

 

Sincerely,

0 Kudos