VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Three-D Plot Demo

by Jay Tanner (8 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (6 Votes)



This is a simple demo of the raw methodology involved in the basics of plotting 3D points on a 2D monitor screen.


All this simple program does is compute the image of a cube one point at a time with a circle drawn on the front face.


Anyone who wants to learn the elementary math involved in plotting a point in 3D space onto a 2D monitor can study the source and experiment with various viewpoint settings in the interface to see how they interrelate and effect things.



Each of the X,Y,Z axes are color coded as RGB respectively help to keep track of the image orientation.



Many comments in the code explain what each part does.



Inputs
There are only four input parameters. The direction of view. The angle of view from above relative to the horizon. The size or image scale factor. The perspective factor.
Assumes
A basic understanding of the sine and cosine used in elementary trigonometry would be helpful, but is not mandatory. It would make the formulas used more meaningful.
Code Returns
The program simply demonstrates the mathematical concept behind plotting 3D images on a computer monitor, so the user can study the mathematical concept behind it. It is done from scratch from direct computation using only VB 6 and the built in sine and cosine functions and native graphics methods. It was written is a way that was intended to be simple to read. (Don't know if this source code will work with VB5, but the formulas used certainly will).
Side Effects
No errors are specifically tested for, so entering extremely abnormal arguments may possibly crash the program. Only single precision values are used for the graphics plotting.

Rate Three-D Plot Demo

Download Three-D Plot Demo

Download Three-D Plot Demo (14 KB)

Three-D Plot Demo Comments

No comments have been posted about Three-D Plot Demo. Why not be the first to post a comment about Three-D Plot Demo.

Post your comment

Subject:
Message:
0/1000 characters