Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 QCChart3D 3D Charting Tools for .Net (VB and C#)
 Rotation on keyPress
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

oliversleep

35 Posts

Posted - 14 Jan 2011 :  05:14:03  Show Profile  Reply with Quote
Hello,

I would like to know if it's possible to do a rotation (X, or Y or Z) on a keyPress event ? With no Mouse event ?

For example, when I press X+L => create a X rotation direction Left.

Thanks.

quinncurtis

1586 Posts

Posted - 14 Jan 2011 :  10:18:17  Show Profile  Reply with Quote
I'm don't know what x-rotation left means, since rotation about the x-axis would normally tilt in or out of the screen.

But otherwise it is simple enough. Add a keypressed event handler to your class derived from ChartView, trap the key you want to trigger on, and call the coordinate systems (pTransform1, made global to the entire class in this case) RelRotateCoordinateSystem method, for the axis and degrees you want to rotate. Call UpdateDraw to force the changes to be applied to the chart.


private void LinePlotSaleVolume_KeyPress(object sender, KeyPressEventArgs e)
{
  //Rotate a negative 5 degrees about the x-axis
  pTransform1.RelRotateCoordinateSystem(new Point3D(-5, 0, 0));
  this.UpdateDraw();
}
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07