Telerik ChartView3D Panning example rotates the view

1 Answer 45 Views
ChartView3D
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Joe asked on 22 Aug 2022, 03:08 AM
A while back, I was looking to implement a pan feature for my ChartView3D, Telerik directed me to this feature request.  It says you aren't implementing the feature but it does contain sample code to allow me to manually pan the view myself.  I have attached a copy of the sample to this post.

It all mostly works. but I've noticed that the horizontal panning is not true horizontal panning.  If you hit the left or right arrow button just a few times sure it looks that way.  But as you keep moving it left or right and the chart approaches the edge of the windows, it begins to move downward also, as if it were the edge of a large, rotating wheel.

What I need is true XY panning. So that if I hit the left button the scene moves left ONLY, not up or down, no matter how far I move it.

Is there some way to adjust the code in the sample to achieve this?  I'll admit that this sort of math is not at all my strong suit.

1 Answer, 1 is accepted

Sort by
1
Accepted
Martin Ivanov
Telerik team
answered on 23 Aug 2022, 08:24 AM

Hello Joe,

Yes, you are right. The example doesn't show an actual panning feature. It just illustrates how to update the camera which should be a good starting point to implement a custom panning feature. The solution in the project shows a very basic code that actually rotates the camera, without moving its position (unless you mouse move). Basically, the position of the camera is fixed and the angle to which it is turned (the LookDirection) changes.

I don't have another example or a good math suggestion, but here is some idea what you can try. Basically, in order to pan properly you can update two properties of the camera (based on your exact perception of panning in the 3D world). The Position and LookDirection. The easiest way to pan would be to update only the Position property. If you want to rotate the camera around the chart, you can update the LookDirection as well.

I've update the project to show the idea with the Position change. I hope that helps.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Joe
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 23 Aug 2022, 03:29 PM | edited

Ah OK, I see what you're doing.  I guess this sort of geometry is child's play for many people but I always have to muddle through.   Seeing what you did I feel awfully dumb for having asked the question.  I think I can work out what i need from that.  Thanks Martin!
Martin Ivanov
Telerik team
commented on 23 Aug 2022, 09:47 PM

No worries. The information about the 3D world in WPF is a bit scarce. Also, it is not very clear what should be the panning behavior in a 3D scene, which brings additional confusion.
Tags
ChartView3D
Asked by
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Martin Ivanov
Telerik team
Share this question
or