3D surface cross-section

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

3D surface cross-section

Post by ArctionPasi » Fri Apr 10, 2015 4:06 pm

Asked a lot, I wrote an example of how to select a cross-section A-B from 3D surface and how to calculate the points between A and B, and finally how to show them in 2D chart below.
3D surface with cross-section
3D surface with cross-section
surface_cross_section.jpg (311.96 KiB) Viewed 15805 times
The project is here:
WinFormsSurface3DCrossSectionVS2010.zip
Surface 3D chart + Area 2D chart VS2010 C# WinForms project. Add Arction.LightningChartUltimate.dll v.6.4 as reference to the project
(12.48 KiB) Downloaded 801 times
I hope this helps you guys :D
LightningChart Support Team, PT

Streght
Posts: 12
Joined: Mon May 30, 2016 9:29 am

Re: 3D surface cross-section

Post by Streght » Wed Jun 01, 2016 3:12 pm

Hi there !

I'm posting on this thread because I'm using this specific exemple as an inspiration for my internship project.

[What I'm trying to do]
I added a checkbox that should reset the default mouse events. The goal is that, when it's checked, left mouse button behave like in other exemples, allowing for the mesh surface to be turned when I click and move my mouse AND doen't trace the cross-section anymore. Right now I successfully disabled the cross-section tracing but I can't get this graph to move with my mouse.

[Why I'm doing this ?]
I'm trying to do this because right now, the only way to turn the mesh around is to click and move the mouse outside of the surface, but since I have very large sufaces and I need to zoom on them, they fill the entire chart area and I cannot move the chart using the mouse, I have to rely on trackbars that aren't very user-friendly.

I couldn't figure out how to simply get the default mouse handlers without coding the entire camera moves from scratch.

Any idea on how to solve this problem ? Thank you for any answer !

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: 3D surface cross-section

Post by ArctionPasi » Wed Jun 01, 2016 3:20 pm

Hello,

So... are you actually looking for a way to pan and zoom the 3D chart contents? By XZ plane?

Set

Code: Select all

_chart.View3D.ZoomPanOptions.LeftMouseButtonAction = MouseButtonAction3D.ZoomXZ;
_chart.View3D.ZoomPanOptions.RightMouseButtonAction = MouseButtonAction3D.PanPrimaryXZ; 
When not using panning and zooming, set it back to default mode:

Code: Select all

_chart.View3D.ZoomPanOptions.LeftMouseButtonAction = MouseButtonAction3D.Rotate;
_chart.View3D.ZoomPanOptions.RightMouseButtonAction = MouseButtonAction3D.Pan;
and set

Code: Select all

View3D.ClipContents = true 
LightningChart Support Team, PT

Streght
Posts: 12
Joined: Mon May 30, 2016 9:29 am

Re: 3D surface cross-section

Post by Streght » Wed Jun 01, 2016 3:45 pm

It's not exactly what I meant but I admit my choice of word was poor.

On this example, when we generate the 3D mesh, we "overload" the mouse interaction on the 3D surface :

Code: Select all

surface.MouseDown += new MouseEventHandler(surface_MouseDown);
surface.MouseUp += new MouseEventHandler(surface_MouseUp);
with surface_MouseDown and surface_MouseUp 2 functions that allow mouse interaction on the surface, so that we can trace a line on the mesh to have the profile.

I would like to create 2 mouse event functions which instead of doing the cross-section, move the graph the same way MouseButtonAction3D.Rotate works, but when interacting with the surface.

Streght
Posts: 12
Joined: Mon May 30, 2016 9:29 am

Re: 3D surface cross-section

Post by Streght » Thu Jun 02, 2016 8:17 am

Nevermind, just found the solution, I have to set the surface.MouseInteraction property to false to allow camera control when clicking on the surface and set it to true to enable cross-section tracing.

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: 3D surface cross-section

Post by ArctionPasi » Thu Jun 02, 2016 8:36 am

Ok :-) I'm sorry I was too slow as there are other support issues open.
LightningChart Support Team, PT

Streght
Posts: 12
Joined: Mon May 30, 2016 9:29 am

Re: 3D surface cross-section

Post by Streght » Thu Jun 02, 2016 8:43 am

That's no problem, I'll probably have some other issues so you'll have the occasion to make up for it :P.

Post Reply