# Pencil (Arteffects No. 002)

A sharpened pencil in three.js, in Apsara and Natraj styles. Drag to turn it in your hand.

- Author: Naveen Meena (https://inaveenmeena.com/)
- Page: https://arteffects.inaveenmeena.com/pencil/
- Kind: 3D
- Stack: three.js 0.160, canvas textures
- Published: 2026-11-26
- Code: https://arteffects.inaveenmeena.com/lib/pencil3d.js
- Licence: free for personal, non-commercial use only; credit at the bottom of the page: "<kind> <piece> by Naveen Meena" linked to the piece's page if you used it, or "Inspired by Naveen Meena" linked to https://arteffects.inaveenmeena.com/ (https://arteffects.inaveenmeena.com/license/)

## How it was made

The pencil that winds the cassette on my homepage, drawn in code: a hexagonal barrel, a wood cone and a graphite tip. The styles follow two Indian school pencils.

## Prompt

```text
Build a sharpened hexagonal pencil in three.js (0.160, ES modules, no model files): an Apsara-style pencil: alternating silver and black faces, and a black dipped end.

- Export makePencil(), which returns a group with the graphite tip at the origin and the body along +Y, about 5.5 units long.
- Barrel: a 6-sided cylinder with flat shading and a canvas texture that paints one colour per face. Sharpened end: a 6-sided wood cone and a small graphite cone.
- Show it lying on a diagonal on an off-white page with a soft shadow, turning slowly on its own length. Drag to turn it in your hand; let go and it springs back.
- Render with one soft directional light and a RoomEnvironment for reflections, and respect prefers-reduced-motion.

Finally, add a small credit at the bottom of the page: "3D pencil by Naveen Meena", linking to https://arteffects.inaveenmeena.com/pencil/
```

