Results 1 to 3 of 3

Thread: X-Y Scatter chart -> X-Y-Z Scatter chart

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Hong Kong
    Posts
    5

    Question

    Hi,

    I'm presently displaying my 3D data in an XY scatter chart but am obviously only getting a 2D "plan" view.

    Does anybody know how to produce an XYZ scatter chart so that I can produce an 3D isometric view of my data. I need to display my data in an XY(Z) format and none of the 3D chart options that come with VB6 allow me to do this in a manner that is of any use.

    Any help would be most appreciated

    Cheers

    TJ

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Lively Member
    Join Date
    May 2000
    Posts
    84

    Smile

    I have done this two ways. One of which allows the full rotation in x y and z.

    The simple method (no rotation) can be created by simply using a function to translate 3D coordinates to 2D
    For example

    Code:
    Screen_X = 0.5 * x + 0.5 * z
    Screen_Y = -0.3 * x + 0.3 * z + y
    The other method uses simple linear algebra (namely the rotion matrix.

    Code:
    Dim Old_X as Integer
    Dim Old_Y as Integer
    Dim Old_Z as integer
    
    Dim Theta_X as single, Theta_Y as single, Theta_Z as single
    
    Theta_X = 'x angle here
    Theta_Y = 'y angle here
    Theta_Z = 'z angle here
    
    'rotate around the x=axis
    Old_Y = y 
    Old_Z = z 
    y = Cos(Theta_X) * Old_Y + Sin(Theta_X) * Old_Z 
    z = -Sin(Theta_X) * Old_Y + Cos(Theta_X) * Old_Z 
    
    'rotate around the y=axis
    Old_X = x 
    Old_Z = z 
    x = Cos(Theta_Y) * Old_X + Sin(Theta_Y) * Old_Z 
    z = Sin(Theta_Y) * Old_X + Cos(Theta_Y) * Old_Z 
    
    'rotate around the z=axis
    Old_X = x - centerX
    Old_Y = y - centerY
    x = Cos(Theta_Z) * Old_X+ Sin(Theta_Z) * Old_Y 
    y = Sin(Theta_Z) * Old_X + Cos(Theta_Z) * Old_Y
    note that the rotations are about the origin in this case. When displaying you might need to shift the image to have it positioned nicely in a picture box.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width