Welcome to Kenzo's site! (KGL)

Kenzo Graphics Library (KGL) NPM Kenzo Graphics Library (KGL) Github Custom math-based graphics engine built for web environments.

NPM
NPM downloads

Kenzo Graphics Library v2 (KGL)

Kenzo Graphics Library (KGL) is a lightweight, math-based 2D and 3D engine for web-based applications and games. Designed for speed, simplicity, and small-scale use, KGL enables fast prototyping and educational graphics applications in HTML environments without external dependencies.

Key Features


If you want to feature your project please fill the form below

Rules

πŸ“€ Submit Your Project for Featuring

If you made something awesome with KGL.js, share it here and get it featured on our site!

Getting Started

HTML Setup

<canvas id="myCanvas" width="640" height="480"></canvas>
<script src="kgl.js"></script>
<script>
  const canvas = document.getElementById('myCanvas');
  const kgl = new Kgl(canvas);

  function animate() {
    kgl.clear();
    kgl.updateRotation();
    kgl.drawSolid(vertices, faces);
    requestAnimationFrame(animate);
  }

  animate();
</script>

HTA Usage (Windows Desktop App Style)

<!DOCTYPE html>
<hta:application>
<html>
<body>
<canvas id="c" width="640" height="480"></canvas>
<script src="kgl.js"></script>
<script>
  const canvas = document.getElementById('c');
  const kgl = new Kgl(canvas);
  const ui = new KglUI(kgl);
  const htmlBox = new KglHTSTB(canvas);
  htmlBox.createBox(10, 10, 200, 100, "<b>Hello from HTA</b>");
</script>
</body>
</html>

Scene Example

const scenes = new KGLscenes();
scenes.add('main', () => {
  voxel.drawVisibleChunks({ x: 0, y: 0, z: 0 });
});

function animate() {
  kgl.clear();
  scenes.render('main');
  requestAnimationFrame(animate);
}

animate();

Entity Example

const player = new KGLentity(0, 0, 0, '#3cf');
function gameLoop() {
  player.z += 0.1;
  player.render(kgl);
  requestAnimationFrame(gameLoop);
}

gameLoop();

New Modules

KGLvoxel

KGLentity

KGLscenes

πŸ“‘ KGLhttp – Basic HTTP Requests (Fetch Wrapper)

`KGLhttp` provides a simple interface for making HTTP requests in KGL-based projects. It allows you to perform basic GET and POST requests using JavaScript's native `fetch()` with added error handling.

🌐 KGLnoise – Procedural Noise Generator

KGLnoise allows generation of noise-based values for procedural terrain, visual effects, and animation.

Noise Types

Usage

import { KGLnoise } from './kgl.js';

const noise = new KGLnoise();
let val = noise.perlin(12.3, 45.6);   // Smooth terrain
let grain = noise.normal(32, 11);    // Static noise
let hybrid = noise.kenzo(8.7, 1.2);  // Mixed style

Use Cases


πŸ§ͺ Example: Using KGLnoise for Terrain Heightmap

const noise = new KGLnoise();
for (let x = 0; x < 100; x++) {
  for (let y = 0; y < 100; y++) {
    let height = noise.kenzo(x / 20, y / 20) * 50;
    kgl2d.drawRect(x * 5, y * 5, 5, 5, true);
  }
}

Best Practices for Lightweight Games


Debugging Guide

Common Errors

Tips


Configuration

Set flags before creating components:

KGLconfig.set({
  AppName: "My Mini Game",
  UseFaceCulling: true,
  Disable2D: false,
  DisableHTSTB: false
});

Examples

Explore the KglUI, Kgl2D, and KglHTSTB classes for ready-made UI and layout tools.


Final Notes

KGL is ideal for indie experiments, educational demos, and rapid prototyping. While it's not intended for complex or physics-heavy projects, it remains highly extensible for creative and compact visual interfaces.

Happy coding!

CDN/LINKS

License

Kenzo Graphics Library v2 is licensed under the GPL 3.0 License.


------------Simple--Kenzo-Graphic-Library-Preview-------------------