Profile image

triangle rasterizer

6,329 11qazxc  2.1 years ago

!!!It's not an entry for challenge!!!
lags a lot and it's the only problem i see at the moment, but 650ms per frame is too much for me.

lib_in_p0...2_x/y/z three points of triangle
lib_in_clr color, one digit red, one digit green, one digit blue
lib_v_t_0...2_0...3 first 4x3 transformation matrix (lowest row is omitted because it's always [0,0,0,1])
lib_fb_t_0...2_0...3 second transformation matrix; same as above.
after both transformations x,y coordinates are in pixels (starting from left-lower corner), and z is depth (towards screen; 0 is far plane and 0.999 is nearest possible value)
lib_draw and lib_clear first one, if true, draws triangle; second one, if true, clears screen. iirc clear command is prioritized.
lib_fb_0...(lib_fb_s_x-1)_0...(lib_fb_s_y-1) is frame buffer, it contains color and depth of pixels (three digits for color and fractional part for depth, RGB.ZZZZ)

Spotlights

General Characteristics

  • Created On Windows
  • Wingspan 3.3ft (1.0m)
  • Length 5.0ft (1.5m)
  • Height 3.3ft (1.0m)
  • Empty Weight 24lbs (10kg)
  • Loaded Weight 24lbs (10kg)

Performance

  • Wing Loading N/A
  • Wing Area 0.0ft2 (0.0m2)
  • Drag Points 1250

Parts

  • Number of Parts 4
  • Control Surfaces 0
  • Performance Cost 60