A program for create any kind of surfaces in 3d.
Figures in rectangular z=f(x,y)
and spherical coordinates sx=f(a,t);sy=f(a,t);sz=f(a,t)
Constants: pi and any int/floating number
Variables: x y a t u v
Operators: + - * / > | etc.
Functions: if(exp,exp1,exp2)
sin() cos() tan() asin() acos() atan()
sinh() cosh() tanh() log() ln() rand()
exp() abs() sqrt() pow(base,exponent)
For anaglyph use red-cyan glasses
Open any kind of image and use it for texture.
The instructions to program;
// For coments
start - To clear the scene. Is the first intruction.
A program without start will be added to the scene. See sample 8\
z=f(x,y) - A surface in rectagular coordinates. Sample 1
For surface in spherical coordinates define first the range of a and t:
sa=0,2*pi and st=0,pi
Then the surface. Sample 2:
sx=f(a,t), sy=f(a,t), sz=f(a,t)
The surface can be moved in the three axis:
dx= dy= dz= See Sample 3.
And rotated in the three axis:
rx= ry= rz= See sample 4.
For planes you may use z=2 or the instruction:
plane(width,height,rx,ry,rz,dx,dy,dz) See sample 5
See Samples > 5 for general application.
trian(width,height,rx,ry,rz,dx,dy,dz) for right triangles. See samples 17, 18
cube(width,height,rx,ry,rz,dx,dy,dz) for cubes. See sample 23
cyli(width,height,rx,ry,rz,dx,dy,dz) for cylinders. See sample 26
cone(r1,r2,height,rx,ry,rz,dx,dy,dz) for cones. See sample 28
sphe(width,height,dx,dy,dz) for spheres. See sample 24
pyra(width,height,rx,ry,rz,dx,dy,dz) for pyramids. See sample 25
para(width,height,alfa,rx,ry,rz,dx,dy,dz) for parallelepiped. See sample 31
para2(width1,width2,height,rx,ry,rz,dx,dy,dz) for parallelepiped2. See sample 36
para3(width1,width2,height1,height2,rx,ry,rz,dx,dy,dz) for parallelepiped3. See samples 43,44
light(width,height,rx,ry,rz,dx,dy,dz) for ligth. See sample 42
trape(width,height,bl,br,rx,ry,rz,dx,dy,dz) for trapezium. See sample 40
bl and br are the bases of the left and right triangles
For repetitive actions use do - enddo. See sample 9, 14, 15 and 16
For textures use: texture(n) being n between 1 and 12.
9 correspond to the image previously open. See samples 18,20 and 21
Aktualisiert am
05.10.2024