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.

Wednesday, March 28, 2012

Collision Of Balls On Move

The moving balls, collision of balls on motion is a nice example of creating user controls with properties and events. I tried the program first in earlier 2001, but got it after a long hard work in 2002. When i used programs as moving a ball by timer and bounced by the the 4 boundaries, top, bottom, left and right easily then tried the collision of balls together as well as the walls

Moving a ball can be created by setting the x and y increment values randomly to a ball and adding the value to the left and top properties of the ball (a circle shape filled with a color), if the value is positive it will add if negative it will decrease at the same time detecting the position reaching any one of the 4 boundaries; once reached, we can bounce back the ball by changing the sign of the value.

Here I created three separate programs, one the balls user control program to create a ball with gradient filled color as created a Color property, second program is Container user control, here we can set boundaries and add balls, there is one event Accident which detect the balls coming to collide and raise the Accident event, the third program is the user program by this program we can add the user controls ball and the container, each ball is added to the container where all the balls are detected and turned the path according the speed of the ball and the direction
In the container user control, a collection object holds the ball objects and by timer it moves the balls with speed of the ball to the direction both are randomly initialized when the ball is added

The both values defines a x increment value and a y increment value with sign and the balls are moved with the values on each execution of the timer event

And each time the position are checked whether any ball is collide with the wall to turn the direction or with any other ball to raise the Accident event. The event arguments provide the details such as the balls come under collide etc..

How it detects the Accident
By the count of the balls collection, it checks each ball with others

Wednesday, March 14, 2012

Type Writer Game

It was born on 2002, Don't know it is a software or a game, but created to be a fun and to propose type writing practice. Panned to create with three meters to show the Speed and accuracy of typing, two meters related to speed; one for Current Acceleration (Chars/Sec) and the other for Average of speed (Chars/Hour) and the third meter for Accuracy to show the number of Right Chars/Chars

A score obtaining depending upon the meter reading. It has come as game, very fun and popular since decided the score proportional to the readings which balancing between the speed and accuracy.

Accidentally, fortunately it has come matched as giving the same feeling as some one is playing a cricket; he should manage the speed (striking rate) and wicket loss. If he play fast, may loss the wicket or if he care not to loss the wicket the score may go down. The same factor is felt by the player as if he care the speed, mistakes appears and reduces the accuracy (number of characters typed right) score or if he cares the typing right for accuracy, the speed score goes down.


There is a count down timer starting from 300 seconds, every own can type chars against the lines (took from type writing materials) appearing with in the time limit.

There is a list of top scores with there score and individual statistics (speed and accuracy). The experience shows the score improves as playing number of games more; One can get a score at very first play and sure it might increase in the next play thus it become a mind management game as well as a good practice for type writing

The other matters are creating new user by admin permission, login and special login; any one can use Guest login without creating the user id




To view 3 DIMENSIONAL DRAWING