Results 1 to 3 of 3

Thread: 3D Projection

  1. #1

    Thread Starter
    Member RaZeR's Avatar
    Join Date
    Jan 2009
    Location
    Russia, Moscow
    Posts
    38

    Question 3D Projection

    Hi all
    I have some questions. I have readed this Wikipedia article, so here the questions:
    - What is the "the viewer's position relative to the display surface." (ex,y,z)?
    - How to get distance from camera to 3D point?
    - How to implement this formulas in VB/C#? I tried to convert, but they don't work

    Please help me
    VB 6, VB.NET, C#, Java, JavaME, C/C++ and Assembler Programmer


    If my post was helpful, rate me

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: 3D Projection

    As I understand it, the situation is as follows:
    - You're walking in a park one day and decide to see the world in 2D. You put a cardboard TV screen in front of you (something like this). Now you want to see where on the TV screen a bird in a tree a ways away should be.
    - You are the e_x,y,z, since you're viewing the TV screen. The screen itself is centered at c_x,y,z and is acting as the "camera" (though that's not a great word for it IMO).

    For your other questions,
    - "How to get distance from camera to 3D point?" -- if you want the distance from two points in 3D space, that's Sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2) where the points are (x1,y1,z1), (x2,y2,z2). Perhaps you want something else, because this is a bit basic for someone trying to do something as complicated as this.
    - "How to implement..." -- I would imagine that, if you didn't know what e_x,y,z was, you wouldn't get good results. I'd also guess that you'll have trouble with the camera rotation angles, since the article implicitly lists them as Euler angles (which are annoyingly obscure; to be honest I'm tempted to rederive that page using Quaternions, which I made a post about a while back).

    In general, I want to warn you that computer graphics is hard for almost all programmers. The geometry and math involved get very complex, very quickly. The Wikipedia page on a topic almost certainly won't give you enough of a background. I had to puzzle through that page for 5-10 minutes before I could figure out what it meant, even though I'm capable of deriving it.

    I'd say you have a few major options.
    - If the project you're working on has no more computer graphics, try to puzzle out projecting points. If this is the case I'd be happy to explain things that confuse you.
    - If the project you're working on has any more computer graphics, do one of the following.
    - If you can, find a graphics library that does what you want for you.
    - If you can't, decide whether or not getting through the math is important enough to bother.
    - If it is, get a book on introductory Linear Algebra (if you can, maybe one geared towards programmers) and a book on computer graphics.

    Good luck!
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: 3D Projection

    If you're interested in looking at some implementations of 3D manipulations in VB.Net, there's a link in my sig that you might be interested in....
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

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