Results 1 to 5 of 5

Thread: need help with my maths

  1. #1

    need help with my maths

    I want to know if a face is visible.

    I have the normal at the faces (at the begining) and I only translate along Oz (in global coordinates) or rotate around Ox and Oy (in local coordinates).

    I must calcute (view vector).(face normal) but how can I obtain the face normal ?

    Thanks for your response and sorry for my bad english.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: need help with my maths

    If you know the vertex's of the face...
    (v1 - v2) . (v3-v2)

    i.e. the dotproduct of two of the faces (polygons) edges (vectors).

    gav

  3. #3
    Member Newbie
    Join Date
    May 2001
    Location
    Hungary
    Posts
    30

    Re: need help with my maths

    You can transform your face normals too to global coordinates.

    Only the affine part of your transformation matrix should be applied to the normal(upper left 3*3 part of a 4*4 matrix).

    If you do not use matrices, you should apply only rotation to your normal, around the origin of the global coordinate system.

  4. #4
    Member Newbie
    Join Date
    May 2001
    Location
    Hungary
    Posts
    30

    Re: need help with my maths

    I've just read Gavin's comment.

    I don't want to criticise him ,
    but his method is just not correct.
    A dot product returns a scalar not a vector.
    You can obtain the normal by calculating

    (v1-v2)x(v3-v2)

    (cross product), but transforming is more efficient(generally).

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: need help with my maths

    haha, sorry, and I was only doing it yesterday.......
    Just been doing angles between vectors and that threw me off....

Similar Threads

  1. Got my maths wrong somewhere
    By Stuart McDonald in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 10-14-2010, 05:45 PM
  2. OpenGL Maths!
    By pran1 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-30-2004, 08:30 PM
  3. Image Maths
    By pran1 in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-27-2004, 06:44 AM
  4. Maths
    By ramana in forum OpenGL: General
    Replies: 3
    Last Post: 01-23-2004, 03:52 AM
  5. 3d Maths
    By roger ramjet in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-31-2002, 09:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean