💾 Archived View for gemini.spam.works › mirrors › textfiles › computers › DOCUMENTATION › ved04b.txt captured on 2022-07-16 at 23:44:07.
⬅️ Previous capture (2022-06-12)
-=-=-=-=-=-=-
???????????????????????????????????????????????????????????????????????????? ? ? ? ? ? ????? ???? ??? ? ? ???? ????? ????? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ? ? ? ? ? ? ????? ???? ??? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ????? ? ? ? ????? ???? ? ??? ? ? ???? ????? ? ? ? ? ? ? ? by Tumblin / Bodies In Motion ? ???????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????? What's in this doc file anyway? - Introduction to VED v0.4 beta - Sample object files - How to create your own objects - Some chat about the source code ???????????????????????Introduction to VED v0.4 beta???????????????????????? VED v0.4 beta is a little prototype for a vector editor that I am working on. At present it is just a text file parser / display program, but eventually will become a menu driven, fully graphical vector editor. Actually, this is a very late release. I had this thing all programmed like five months ago, but lost interest in it because I have been working on the newer graphical version of it, which is a total reprogramming of this one. This version comes with a collection of object files that you can take a look at to help you create some of your very own 3D light source shaded polygon objects. The format is very simple and anybody should be able to do it. If you've been wanting to make a 3D demo object, but never had the means to, then here's your chance! Here's sytax for the editor: VED04B filename.ext I am using the extension .v04 just in case I decide to change the format. Wouldn't want the object files getting mixed up with the different versions! If you've made any objects with VED v0.3 beta, the file format is exactly the same, just rename the files from "filename.V03" to "filename.V04". But this version can load with the .V03 extension without a problem. I just like to keep things a little organized :-) The vector object display program (VED04B.EXE) is menu driven and allows you to do a few simple things with the object. You can rotate the object on the x axis, y axis, z axis, and all three axis at once. You can change the position of the light source. You can also increase or decrease the distance the object is from the center of the world (0,0,0). The default distance is 256. If you design a large object, it is a good idea to increase the distance so that the object will fit onto the screen. ????????????????????????????Sample object files????????????????????????????? Here is a list of the objects that are part of this release: (all of them are created by me, Tumblin) 14SIDED V04 - 14 sided prism by Tumblin CUBE V04 - simple cube by Tumblin CYLINDER V04 - cylinder by Tumblin LETTERR V04 - letter "R" by Tumblin LETTERT V04 - letter "T" by Tumblin PUCK V04 - hockey puck by Tumblin PYRAMID V04 - pyramid by Tumblin QBINAQB V04 - cube inside a cube by Tumblin SPHERE V04 - sphere by Tumblin STAR V04 - 6 pointed star by Tumblin SWORD V04 - sword by Tumblin TRIPIPE V04 - triangular pipe designed by Total Package 3DFLAG V04 - Canadian flag by Rush CONE V04 - cone by Rush DIAMOND V04 - diamond by Rush PAPERAIR V04 - paper air plane by Tumblin ????????????????????????How to create your own objects?????????????????????? If you think you are ready to start making your own objects, then read on. First I will explain a little theory of how 3D works. A vector object is simply a bunch of points that are placed at specific coordinates on an imaginary graph. Those points are then joined together forming the corners of polygons. All of the polygons together create the object. If you remember the cartesian graph that your math teacher yacked about in high school, then you are well on your way. Its the same idea except you have one more dimension. You have the vertical & horizontal dimensions, and now a depth. Each 3D point is specified with three numbers in the form of (x,y,z). X is the horizontal dimension (left and right). The center is at 0. X grows increasingly negative as you move left, and grows increasingly positive as you go to the right. See the number line below: -5 -4 -3 -2 -1 0 1 2 3 4 5 - <------------------------- -------------------------> + Y is the vertical dimension (up and down). The center is at 0. Y grows increasingly negative as you move down, and grows increasingly positive as you go up. See number line below: + ^ | 5 | 4 | 3 | 2 | 1 0 |-1 |-2 |-3 |-4 |-5 v - Z is the depth dimension. The center is at 0 (surface of your monitor). Z grows increasingly negative as you go into the screen, and grows increasingly positive as you come out of the screen towards your face. See number line below: - / -5 <-- inside screen / -4 / -3 / -2 / -1 ................ 0................. <-- screen / 1 / 2 / 3 / 4 <-- air infront of screen / 5 + So when you put it all together, you have a graph system that looks like this: up (+) (-)(into screen) | / | / | / | / | / | / left(-) -----------+------------- (+)right / | / | / | / | / | / | (towards you)(+) (-) down To specify a 3D point you simply state its x, y, and z coordinate together, like (x,y,z). The next thing to understand about 3D polygon objects is how to construct polygons. Polygons are just multi-sided closed off shapes. In this vector editor, there is a restriction, as most polygon systems do, you must make sure that the polygons are convex. What this means is that when you draw a straight line through any part of a polyon, it can only cut through two edges. Any more will make it a concave polygon and will not display properly when viewed. A simple way to identify if the polygon is convex is to see if all of the vertices (corners where two edges meet) point outward from the interior. See the diagram below for an idea of what I mean: ------------\ / \ / \ This is a convex polygon. / \ / \ It WILL display correctly. / | \ | Notice how all the corners point \ | outwards. \------------------------ ------------\ / \ / \ This is a concave polygon. / \ / \ It will NOT display correctly / /---------- \ / Notice how not all the corners \ / point outward. \----------/ To get around this problem, split the polygon into 2 or more smaller polygons, like this: ------------\ / - \ / - \ These are 2 convex polygons joined / - \ together to make up a concave one. / - \ - - ----------- It will now display correctly. \ / \ / Notice how all the corners of each \----------/ polygon point outward from its center. To be able to draw the polygons, you must list the vertices that you want to connect together. Guess what, there is another restriction! The vertices must be listed in counter-clockwise order when that particular polygon is facing you. If you listed them clockwise, then it will not be displayed. This is how the polygon drawing code eliminates non-visible surfaces (a.k.a backface removal, or backface culling). Suppose you wanted to have some polygons that were supposed to be visible on both sides instead of just one. How would you get around the restricton that a polygon can only have one visible side? Well, what you do is define one side of the polygon in counter-clockwise order, then spin the polygon around so that the other side is visible and define that in counter-clockwise order. So this means that you define the same polygon twice, once for each visible side. Okay, you now know enough to be able to start creating your own objects. Let's introduce the file format now. First here are some pointers on what is allowed to be in the file: Comments are allowed on any line in the file. You start the comment with the "*" character and it ends with the carriage return (when you press the ENTER key). Essentially this is the same idea as comments in a C++ program. Because the comment goes to the end of the line, you must make sure that you don't comment out the required data that you need to make your object load correctly. So put them either on their own line, or AFTER all the important information is there. All of the numbers that appear in the file (except for the ones after the comment character "*" - they are not used anyway) must be integers. This means that they can have a value between -32768 and 32767, including zero. All of the numbers must be separated by a character other than a numerical digit or a negative sign. I use commas because thats how I was always taught to separate items in lists :-) A word of warning!!! You MUST add a separation character after the last uncommented number on the line. Remember the editor will ignore everything in the comment lines and blank space throughout the file. What would happen is the editor would read the last number on the line and then stick the first number on the next line to the end of the previous line. This makes a big mess and can crash the editor. Negative numbers should have a negative sign directly infront of the number (eg. -5,-123,-30). Positive numbers should not have any symbols infront of them at all. (eg. 1,15,66). The very center of the object is at coordinate 0,0,0. This means that all of the rotations are performed using this coordinate as the pivot point. Please keep this in mind when creating your objects. If you know what you are doing, then you can offset the object a bit and then you can get some cool looking whirling effects :-) Now that you know what is allowed and what is not, here is what must appear in the file: a) the number of vertices in the object b) list all the vertices by giving their 3D coordinates x,y,z. c) the number of polygons in the object d) list all the polygons in the following format: i. the number of vertices in the polygon ii. list the vertices making the polygon in counter clock wise order when visible iii. the color of the polygon (not used in VED v0.3 beta, but will have a use in later versions to choose a color gradiant range, so that you can have multiple light source shading colors to use). The following list shows the light source shading colors available in VED v0.4 beta: 1 = grey (white to dark grey) 2 = red (light pink to deep red) 3 = yellow (light yellow to tan) 4 = blue (light blue to deep blue) 5 = purple (light purple to deep purple) 6 = green (light green to deep green) 7 = brown (tan to dark brown) Thats it! Thats all you need to make an object. A good thing to do is to comment EVERYTHING!!!!! I can't stress this enough. When you are listing the vertices, put a comment at the end of the line and number them starting at zero. This will be necessary when you are ready to start defining your polygons. When you are defining your polygons, do step (d) all on the same line, and group all the polygons that make a major section of your object. This makes "debugging" your object easier. The following is a sample object that makes a cube: --------------------------------- cut here ----------------------------------