Results 1 to 6 of 6

Thread: Pointing an object (surface) towards the camera.

  1. #1

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I would like an algorithm to "point" a surface of an object toward the camera. I know the position of the camera, and I know the centerpoint of the surface. Would anyone here know how to accomplish this?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I think you need to find a normal to the plane of the surface. You can find one using the cross product of two vectors in the plane, or probably some other way. My 3D geometry is something I'm working on.

    You'll probably need to find a unit vector, normal to the plane and point that at the camera's vertex. If you have local coordinates and world coordinates for the object you should just have to change the world coordinates.... I think.
    Harry.

    "From one thing, know ten thousand things."

  3. #3

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Hehe... the funny thing is, I seem to know less than you

    I know what a normal is, but I thought that they were only used to make a smooth surface! Also, I don't know how to get the 'cross product' of two of the vectors.

    And in the second paragraph, you told me just to point the vector at the other vector! I already know these vectors, and that was my question, how to I point it at the camera.

    Anyways, I posted in the maths forum and came up with a response, said he'd come up with the code if I had more details...

    Thanks anyway, HarryW.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Heyguys!!!

    This is pretty darn cool, eh?

    Actually,theeffectisbetterwhenyouhavelongertext!

    Well, that's about it, I just downloaded this tool and it makes everything look pretty cool!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Never mind me, I just downloaded this cool tool for VB-World posts. It makes everything look spiffy, so to speak...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Heh, very nice

    I noticed that Sam had picked up the topic, and I really have no hope of coming up with anything he wouldn't come up with (Sam is the local maths guru after all), so I think I'll let him come up with the answers and just watch and learn

    There is a pretty good geometry tutorial at flipCode if you're interested.
    Harry.

    "From one thing, know ten thousand things."

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