Thursday, March 29, 2012

3 DIMENSIONAL DRAWING

      It was started at 2001, I dreamed, liked to rotate objects in graphics horizontally, invert vertically, using VB 6.0 graphics, checked the possibilities by coding, used paper works long days. It had been started with simple geometry works with circles, trigonometry, Pythagoras theorem etc.. later found some simplifications after reading a book of  my elder brother about 2D, 3D drawing by Matrix representations (the same we can see in college studies)..

     The first program was to be created is a reusable component named ,ThreeDDrawing, it has come with some important functions X-Axis rotation, Y-Axis rotation, Z-Axis rotation, Any-Axis rotation (No need for the others), to initialize the axis end points, etc..  when, going to use the component, the expectation about using the component was being only rotate the object (graphics drawing) with Timer control like animations, but it was not only being used to rotate the object, I realized it's useful to create many objects also, here are some sample objects

First we can create one or two base lines then can rotate at specific angles about an axis to obtain the points and can draw the lines according to the points, because most of the objects are symmetry in shape, we can loop to repeat and simply the code as necessary      
              
  • A resuable component (ThreeDDrawing) for rotating any point in 3Dimentionally was created
  • Can rotate any point about any axis
  • Can create any shape
  • Animations can be done with rotation of the object about any axis
  • Here are some sample shapes created by the component


STAR IN 3D VIEWS
Rotating the object about X, Y and Z axes; each axis remains constant it's position on each rotation 



Rotating X, Y and Z axes within the object
Unlike the previous where the axes didn't move within the object on each rotation here the axis is rotating within the object when it gets rotated; I found the better after geting result of the previous and tried to get the result




Creating a shepere
An exampe about creating any object by using the ThreeDDrawing;here creating the object is starting with initialising with a point (base point) then rotating it with a specified angle by looping as developing an arc, As well as repeating the arc creating process with a loop and an angle as creating the sphere by connecting the individua points, the entire object is ready

Creating a tube

Creating a box

The video shows how the component is useful to create animation. First the object is created by drawing with lines, then the 3 axes are initialised through the center of the box.


The animation is done by rotating the object by all the three axes (X, Y and Z) within the Timer control

Creating the motion of the Sun, the Earth and the Moon


It's an example of creating two axes set, The primary axes are centered toward the sun, where as the secondary axes are set with center of the earth. The secondary axes are also rotating about the sun within earth.The moon is rotated about the earth by using the secondary axes by all the three axes.



So that, the earth with the rotation of the moon about itself is rotating sun about the Y axis of the primary. Here the whole set can be rotated by the external x, y and z rotation like used in star and tube.

No comments:

Post a Comment