Important alert: (current site time 7/16/2013 3:20:57 AM EDT)
 

winzip icon

Stereo Vision, TRUE 3D! *Minor Update*

Email
Submitted on: 1/8/2001 10:34:11 PM
By: Dennis C. Urie 
Level: Advanced
User Rating: By 33 Users
Compatibility: VB 5.0, VB 6.0
Views: 30353
 
     Update: Added option to allow viewing model using a cross eyed method, as well as the original "wall eyed" method.

This program renders two images of a simple model from separate camera positions. When viewed similar to a Stereogram image it produces a TRUE 3 Dimensional view of an object. No special viewing devices are needed to view in full 3D. (See the help file for how to view it properly.)

This example uses custom D3DTLVertex (Transformed and Lit Vertices) for rendering. The program is responsible for the transforming and lighting of the 3D scene and only sends the screen coordinates, rhw, and color of each vertex to D3D for rendering.

This program implements most functions needed for 3D rendering in SOFTWARE including:

3D Object Rotation using 3X3 Matrix Transformation
Surface Normals
Backface Culling
3D Projection to 2D screen
Z Sorting
Dynamic Lighting (Flat Shading and Gouraud Shading.)


 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
1/9/2001 12:50:06 AMWarren

Very nice! I give it 5 thumbs up, keep up the good work!
(If this comment was disrespectful, please report it.)

 
1/9/2001 10:32:24 AMMax Seim

All I can say is WOW!
One interesting thing...
When I look at the sphere (globe), I
see it 'concave', whereas my wife sees
it as normal ... must be a right-brain
left-brain thing?

5 stars on this one!


(If this comment was disrespectful, please report it.)

 
1/9/2001 6:57:58 PMDennis

Thanks for the positive feedback. You are probably right about the left/right brain thing (in a way.) What is really happening is that you are looking at it cross eyed as if the image was in front of the monitor. However, the program is setup to be viewed as if the image was inside, or beyond the screen (wall eyed.)

After doing a little research I am starting to realize many more people view stereoscopic images cross eyed than I originally thought. Personally, I am not able to view them cross eyed no matter how hard I try.

I will be making an update very soon (probably tonight) that adds the ability to swap the images to allow for cross eyed viewing as well.

Again, thanks for the feedback.
(If this comment was disrespectful, please report it.)

 
1/9/2001 7:00:47 PMmwcStudio.com

Great code.

How can I import WRL(VRML2.0) files to this program from Photo Modeler Lite ?
(If this comment was disrespectful, please report it.)

 
1/10/2001 12:35:48 AMEisen Teo

This is just the thing I need to learn some parts of Direct3D. Great job.
(If this comment was disrespectful, please report it.)

 
1/10/2001 4:21:47 AMRobert Rayment

I have DirectX8 but get Automation error. Any idea what this might be?

(If this comment was disrespectful, please report it.)

 
1/10/2001 4:39:01 AMRobert Rayment

My Automation error was caused by not having the Graphics Performance set to maximum. I usually have it down a notch or two because not all VB graphics will work at maximum!!

(If this comment was disrespectful, please report it.)

 
1/10/2001 4:59:42 PMDennis

Robert, I sent you an e-mail requesting a little more info. Thanks for reporting the error.

mwcStudio, I only intended to use custom models so I could have more control over the rendering. I have however checked out some .wrl files
and think I may be able to write a conversion program. There will be quite a few limitations though. I'll post again after I take a better look at it.

(If this comment was disrespectful, please report it.)

 
1/11/2001 2:02:39 PMSimon Price

This is a cool example. It makes your eyes hurt, but it's good :) Here, have a well deserved excellent vote.
(If this comment was disrespectful, please report it.)

 
1/12/2001 6:15:41 AMMikie

Well done! Brillient interface and a stunning effect.

(If this comment was disrespectful, please report it.)

 
1/14/2001 3:28:20 AMKeny

Very Good !

I give you à 5 stars !

But i would like if it posible to make a 3d maker ? Your fikles seems to be easy to write but i would like to make more complex 3d form !

Anyway explain me a liter more how to make these 3d things ...

Very good
(If this comment was disrespectful, please report it.)

 
2/11/2001 6:42:33 PMViper Technologies

Where can I download DX8? I can't find a download on msdn.microsoft.com. If possible, could someone just send me the library (DX8VB.dll or something)?
(If this comment was disrespectful, please report it.)

 
2/12/2001 5:50:42 PMwowowowow

holey sh*t!
(If this comment was disrespectful, please report it.)

 
2/20/2001 5:14:11 PMShawn Elliott

DirectX 8 is at www.microsoft.com/directx
(If this comment was disrespectful, please report it.)

 
2/23/2001 10:46:29 PMPaul Rosebush

Great Demo, reminds me of a 3d demo we used in mech eng which utilized the red/green lines...images stand off a flat surface, you reach for and think you can touch them. As in 3d photography where two images are taken at different angles similar to the space between our eyes thus crossing of the eyes is necessary to see the image in true 3d visual. Again, good demo and I will try to write someting that displasy the version I mentioned. keep up the good work.
(If this comment was disrespectful, please report it.)

 
1/8/2002 1:14:25 PMbeastz

I have to give this 5. Its brilliant.
(If this comment was disrespectful, please report it.)

 
1/9/2002 12:45:14 PMAndrew Boey

FIVE - E globe for you my man!!
Great clean work!!
(If this comment was disrespectful, please report it.)

 
1/10/2002 11:03:07 AMKalai Ace

Amazing work!
Hope to see more great code from you.
5 globe from me.
(If this comment was disrespectful, please report it.)

 
8/4/2003 1:05:13 AM

Exellent!!
But I don't know how do you make *.def files..
Whether Exporting Vertex Data from CAD / 3D Max or other tools...
Please Help.. Show me a course of Convert 3d-files into [*.def file]
send me your sample or data or method.....if you send that...i will very very thanks.. ^^
(If this comment was disrespectful, please report it.)

 
8/10/2007 10:19:54 PMLefteris Eleftheriades

Hi i have windows vista and cant find the typelibrary anywhere can u compile this and post a link pls?
(If this comment was disrespectful, please report it.)

 
7/10/2009 9:02:23 PMChris Jennings

I just stumbled across this code while searching for "gouraud" and I have to say this is quite possibly the most incredible visual feast VB has ever given me. It's like VB meets iMax. I must've played with the BoxFrame object, eyes crossed, while staring at the screen for about an hour. Utterly mesmerising. (*)(*)(*)(*)(*)
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.