|
-
Nov 4th, 2009, 06:50 AM
#1
Thread Starter
Member
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 
-
Nov 4th, 2009, 07:52 AM
#2
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.
-
Nov 7th, 2009, 05:28 AM
#3
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....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|