_Title "Pyramid with tile texture" 'Coded by Ashish
'26 march, 2021
'for camera
'coordinate data
pyramid_coord(0).x = 0: pyramid_coord(0).y = 2: pyramid_coord(0).z = 0
pyramid_coord(1).x = -2: pyramid_coord(1).y = -2: pyramid_coord(1).z = -2
pyramid_coord(2).x = 2: pyramid_coord(2).y = -2: pyramid_coord(2).z = -2
pyramid_coord(3).x = 0: pyramid_coord(3).y = -2: pyramid_coord(3).z = 2
texcoord(0).x = 0: texcoord(0).y = 0
texcoord(1).x = 0.5: texcoord(1).y = 1
texcoord(2).x = 1: texcoord(2).y = 0
glAllow = 1
'set these shades values as per your requirement
shade1&
= _RGB(15, 190, 200)shade2&
= _RGB(240, 10, 70) i = 1
i = i * -1
CircleFill x + offx, y, 20, shade2&
offx = offx + 3
Line (x
+ ax
, 0)-(x
+ ax
, 700), shade2&
Line (x
+ ax
+ 50, 0)-(x
+ ax
+ 50, 700), shade2&
Paint (x
+ ax
+ 49, 0), shade2&
, shade2&
Paint (x
+ ax
+ 1, 0), shade2&
, shade2&
ax = ax + 2
glInit = 1
'texture
'projection settings
gluLookAt 0, 0, 6, 0, 0, 0, 0, 1, 0
'drawing pyramid
_glTexImage2D _GL_TEXTURE_2D
, 0, _GL_RGB
, _Width(texture_data
), _Height(texture_data
), 0, _GL_BGRA_EXT
, _GL_UNSIGNED_BYTE
, m.OFFSET
t = t + 1
x0 = R
y0 = 0
e = -R
y0 = y0 + 1
Line (x
- x0
, y
+ y0
)-(x
+ x0
, y
+ y0
), C
, BF
Line (x
- x0
, y
- y0
)-(x
+ x0
, y
- y0
), C
, BF
e = e + 2 * y0
Line (x
- y0
, y
- x0
)-(x
+ y0
, y
- x0
), C
, BF
Line (x
- y0
, y
+ x0
)-(x
+ y0
, y
+ x0
), C
, BF
x0 = x0 - 1
e = e - 2 * x0
Line (x
- R
, y
)-(x
+ R
, y
), C
, BF