Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_d3d_draw_ellipsoid

(view raw script w/o annotations or w/e)
1
function d3d_draw_ellipsoid(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8, argument9) //gml_Script_d3d_draw_ellipsoid
2
{
3
    var __x1 = argument0
4
    var __y1 = argument1
5
    var __z1 = argument2
6
    var __x2 = argument3
7
    var __y2 = argument4
8
    var __z2 = argument5
9
    var __tex = argument6
10
    var __hrepeat = argument7
11
    var __vrepeat = argument8
12
    var __steps = argument9
13
    if (__steps < 3)
14
        __steps = 3
15
    if (__steps > 128)
16
        __steps = 128
17
    __cc[__steps] = 0
18
    __ss[__steps] = 0
19
    for (var __i = 0; __i <= __steps; __i++)
20
    {
21
        var __rad = __i * 2 * pi / __steps
22
        __cc[__i] = cos(__rad)
23
        __ss[__i] = sin(__rad)
24
    }
25
    var __mx = (__x2 + __x1) / 2
26
    var __my = (__y2 + __y1) / 2
27
    var __mz = (__z2 + __z1) / 2
28
    var __rx = (__x2 - __x1) / 2
29
    var __ry = (__y2 - __y1) / 2
30
    var __rz = (__z2 - __z1) / 2
31
    var __rows = floor((__steps + 1) / 2)
32
    var __oldrep = gpu_get_texrepeat()
33
    gpu_set_texrepeat(true)
34
    for (var __j = 0; __j <= (__rows - 1); __j++)
35
    {
36
        var __row1rad = __j * pi / __rows
37
        var __row2rad = (__j + 1) * pi / __rows
38
        var __rh1 = cos(__row1rad)
39
        var __rd1 = sin(__row1rad)
40
        var __rh2 = cos(__row2rad)
41
        var __rd2 = sin(__row2rad)
42
        d3d_primitive_begin_texture(5, __tex)
43
        for (__i = 0; __i <= __steps; __i++)
44
        {
45
            d3d_vertex_normal_texture((__mx + __rx * __rd1 * __cc[__i]), (__my + __ry * __rd1 * __ss[__i]), (__mz + __rz * __rh1), (__rd1 * __cc[__i]), (__rd1 * __ss[__i]), __rh1, (__hrepeat * __i / __steps), (__j * __vrepeat / __rows))
46
            d3d_vertex_normal_texture((__mx + __rx * __rd2 * __cc[__i]), (__my + __ry * __rd2 * __ss[__i]), (__mz + __rz * __rh2), (__rd2 * __cc[__i]), (__rd2 * __ss[__i]), __rh2, (__hrepeat * __i / __steps), ((__j + 1) * __vrepeat / __rows))
47
        }
48
        d3d_primitive_end()
49
    }
50
    gpu_set_texrepeat(__oldrep)
51
}