Results 1 to 18 of 18

Thread: [Resolved] old normals question.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2004
    Posts
    259

    Question [Resolved] old normals question.

    Dx7 VB6

    VB Code:
    1. 'Calculate Normals
    2.                     ' subtract point2 - point1 to find a vector
    3.                     ' no light, trying new method of point3 - point2
    4.                     DataVector2.X = PointX(3) - PointX(2)
    5.                     DataVector2.Y = PointY(3) - PointY(2)
    6.                     DataVector2.Z = PointZ(3) - PointZ(2)
    7.                    
    8.                     'subtract point3 - point1 to find another vector
    9.                     DataVector3.X = PointX(2) - PointX(1)
    10.                     DataVector3.Y = PointY(2) - PointY(1)
    11.                     DataVector3.Z = PointZ(2) - PointZ(1)
    12.                    
    13.                    
    14.                     ' find vector cross product and store in DV1
    15.                     DataVector1.X = (DataVector2.Y * DataVector3.Z) - (DataVector2.Z * DataVector1.Y)
    16.                     DataVector1.Y = (DataVector2.Z * DataVector3.X) - (DataVector2.X * DataVector1.Z)
    17.                     DataVector1.Z = (DataVector2.X * DataVector3.Y) - (DataVector2.Y * DataVector1.X)
    18.                    
    19.                     ' normalize vector for light
    20.                     Dx.VectorNormalize DataVector1

    when i run the program, and i check for the normal of the surface i collide with, i get this in my debug:

    Impacted Normal----
    -1.#IND
    -1.#IND
    -1.#IND

    it doesn't matter what direction the normal is facing.
    i need normals here, not because i'm working with light, but
    because i'm working with collisions. it'll help me figure out the sliding.

    Am i not doing something wrong?
    Last edited by Waxy; Nov 17th, 2005 at 01:30 AM.
    ----------------------------------------------------

    Missing the days of GWBasic 1.1
    WaxyStudios.com

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