Select to view content in your preferred language

Cones: Is This Intended Behavior?

1147
2
Jump to solution
10-11-2019 10:29 PM
RobBever
Regular Contributor

I've found some behavior with the 3D cones that's confusing me. I want to use the cone as a Field of View for an object, so emanating at a particular angle from a particular point. I've noticed some confusing things about the cones created from SimpleMarkerSceneSymbol.CreateCone(), however.

1. I'm pretty sure what's listed as diameter is actually radius. The first attached picture (Cone_Radius.png) is an example of me creating a cone where the first value is 50000 and the second value is 100000. I'm pretty sure the height and diameter here is the same, so I believe the second parameter to CreateCone() is actually radius.

2. The rotation behavior is not what I expected based on the anchor point. When I create my cone at roll 0, pitch 0, yaw 0, and with anchor point Top, I get what's seen in Cone_Roll0_Pitch0.png, which is what I'd expect. Note that I've created a sphere at the same point as the point I used for the cone.

However, if I then set pitch to 45, I get what you see in Cone_Roll45_Pitch0.png. I would expect that the cone would rotate about the anchor point, however it appears to rotate about its own center point instead. This is going to make it difficult for me to rotate the cone and place the top of the cone where I want it to be.

If this rotation behavior is intended, then anchor points don't really mean what I would have thought they mean. I wouldn't have thought they only apply to the initial placement, I would have thought they'd apply to the rotation as well.

I'd like confirmation that this is how it's supposed to work, and if there's a way to specify the point about which to rotate my cone, that would be very helpful. If I can't do that, the math is going to be a pain. Thanks.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
RobBever
Regular Contributor

It looks like if you add a SimpleRenderer and use PitchExpression, RollExpression and HeadingExpression, then you use Attributes of the Graphic to set Roll, Pitch and Heading values, then you can get it to rotate about the Anchor Position.

I don't really understand why the PitchExpression of the Graphic rotates in a totally different way than the Pitch of the SimpleMarkerSceneSymbol does, since the Anchor Position is part of the SimpleMarkerSceneSymbol already, but I was able to get the kind of rotation I wanted.

View solution in original post

0 Kudos
2 Replies
RobBever
Regular Contributor

If this is intended then it seems like anchor points aren't very useful for 3D objects.

In most cases objects are going to be rotated in some way, and if the rotation is about the center of the object rather than the anchor point, then you're going to have to adjust the position of the object based on the center anyway.

At that point you may as well just anchor at the center and do the calculations so the part of the object you want to place will end up in the right spot. The anchor point just adds an offset.

Let me know if I'm not correctly understanding how the rotation works. Thanks.

0 Kudos
RobBever
Regular Contributor

It looks like if you add a SimpleRenderer and use PitchExpression, RollExpression and HeadingExpression, then you use Attributes of the Graphic to set Roll, Pitch and Heading values, then you can get it to rotate about the Anchor Position.

I don't really understand why the PitchExpression of the Graphic rotates in a totally different way than the Pitch of the SimpleMarkerSceneSymbol does, since the Anchor Position is part of the SimpleMarkerSceneSymbol already, but I was able to get the kind of rotation I wanted.

0 Kudos