1.1.1 • Published 9 months ago

term3d v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

term3d

Display your lowpoly 3d models in the terminal!

npm.io

Instaltion :

npm i -g term3d

Also available in the AUR

yay -S term3d

How does it work?

The renderer doesn't use the traditional perspective projection instead, it uses another projection method called weak perspective projection, which is not common at all because its very limiting, but for a simple model viewer without a moving camera it's good enough, plus it's very simple to implement here is the algorthim for it:

point2d.x = (point3d.x * fov) / point3d.z + (screenWidth/2)
point2d.y = (point3d.y * fov) / point3d.z + (screenHeight/2)

Useage :

term3d <your_model.obj> [Options]

Options:
  --view     -v      The View type either "fill" or "wire" of "points"
  --fov=100  -f      The fov of the camera
  --far=100          The far plane of rendering
  --scale    -s=50   Model scale, if there is no model displaing lower it
  --y-speed  -y=0.05 Sets the speed of rotation around the y axis   
  --point-char=.     The character of point rendering
  --wire-char=:      The character of wire rendering
  --color    -c      black, gray, white, red, blue, yellow, green, magenta, cyan, brightBlack, brightWhite, brightRed, brightBlue, brightYellow, brightGreen, brightMagenta, brightCyan

Controls:
  Arrow keys : move the camera
  z-x        : move the camera closer and fearther 
  1-2-3      : change the drawing mode
  w-s        : rotate along the x axis
  a-d        : rotate along the z axis
  e          : toggle y rotation

TODOS

  • Fix weird line rendering
  • add custom ascii gradient based on user input
  • support multiple file formats (.gltf/.glb, .stl, .fbx)
  • Add to the AUR
1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago