![]()
Online Tutorial - Introduction to the 3d graphics
| Objectives | Learning the basic principles working with 3d graphics in Stratum 2000 | ||||||||||||||||||||||||||||||||||||
| Operations with graphics 3D objects | Three-dimensional objects exist within
three-dimensional space and can be visualized in the special two-dimensional object: Projection3D
(Graph2d library). |
||||||||||||||||||||||||||||||||||||
The operation objects (handle control of objects)
are arranged in the library GRAPH3D.LIB. There is the variable hSpace3d in all objects,
which specifies the descriptor (unique number) of three-dimensional space. This variable
can be set by linking or be defined in the object by the level above as well
They are much alike and have identical variables:
Some objects also have special variables:
|
|||||||||||||||||||||||||||||||||||||
| Exercise 1 | You need the file with the ready
three-dimensional scene:
You can get here. The file should be saved in the project directory. Create a new project and insert the GraphicSpace object (Unit library). As the window contents will be read out from the 3d.vdr file. You should set the FileName variable in 3d.vdr (or set full path to the file). Now set the Projection3D object (Graph2d library) on the scheme. The Projection3D
object can create a new projection of three-dimensional space, but it can also use already
created and drawn one. For this, set in the ObjectName variable the name of
already existing projection. In our case this is 3d. Set the Move3d object in order to move torus (three-dimensional object TORE01) along the cylinder on the OY axis. Then link hSpace3d variables of this object and Projection3D object and set the name of
the moving object. (ObjName variable) t:=t+0.1 where y0 - initial position, r - amplitude, f - phase, t - time. Now link variable y of
new object and Move3d object. |
||||||||||||||||||||||||||||||||||||
| Exercise 2 | Rotation of the sphere around the torus. For this
set the Move3d object and link hSpace3d variables of this object and of Projection3D
object. Set the name of the moving object. (ObjName variable) - SPHERE, and of the object,
in coordinate system of which the moving takes place. (BaseName variable) -
CYLINDER. Create a new object, which text will set the law of the object moving: Rotation on small radius: a1:=a1+0.2 y:=0.16*r1*sin(~a1) _x:=r1*cos(~a1) Rotation on large radius Set initial values of variables r1- 15, r - 40. Then link x, y, z variables of new object and of Move3d object |
||||||||||||||||||||||||||||||||||||
| Additional exercise | Try to control any three-dimensional graphics
object with the help of VSlider and HSlider objects to change the colour of three-dimensional objects take the advantage of ObjectColor3d objects. Change the colour in the external object by the arbitrary law. |
Back : Index : Forward
Trademarks & Copyright © 1998 Stratum Modeling Group. Last modified on 6-January-1999.