3d-graphics

3d-graphics is a cursor rule for Cursor from madebyaris/advance-minimax-m3-cursor-rules. It costs 0 tokens per session (1,153 once invoked), scanned A, original, MIT.

A syntax guide for Three.js and React Three Fiber, tools for creating interactive 3D scenes in web pages.

In plain words
What is it for?
Setting up scenes and canvases, loading models, adding controls and environments, sizing renderers to their containers, and building 3D interfaces.
Why use it?
It prevents common setup and sizing errors, such as a 3D canvas rendering at zero height or using properties unsupported by the installed package versions.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Setting up scenes and canvases, loading models, adding controls and environments, sizing renderers to their containers, and building 3D interfaces.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/madebyaris/advance-minimax-m3-cursor-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 3d-graphics

README.md
[![agentmods](https://agentmods.dev/badge/rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics/github.svg)](https://agentmods.dev/rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics)
Your own site
<a href="https://agentmods.dev/rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics"><img src="https://agentmods.dev/badge/rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 3d-graphics

Your own site · 80×15
<a href="https://agentmods.dev/rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics"><img src="https://agentmods.dev/badge/rules/madebyaris/advance-minimax-m3-cursor-rules/3d-graphics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,153 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01153
Opus 5 $0.00000 $0.00576
Sonnet 5 $0.00000 $0.00231
Haiku 4.5 $0.00000 $0.00115

Measured 10d ago against content hash 9f9721fe0ff4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

3d-graphics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/3d-graphics.mdc · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

3D Graphics — Syntax Reference

Mechanical patterns for Three.js, React Three Fiber (R3F), and @react-three/drei. For aesthetic direction, performance tiers, responsive/mobile WebGL, degradation, accessibility, and verified recipes, load the 3d-web-experiences skill (reference.md for full scenes and bug catalog).

Verify package APIs against installed versions before asserting prop names.


CRITICAL: Container Dimensions

A WebGL canvas without a sized parent renders at zero height or wrong aspect.

// WRONG
<div><Canvas><Scene /></Canvas></div>

// CORRECT — explicit height on the container
<div style={{ height: '500px', width: '100%' }}>
  <Canvas><Scene /></Canvas>
</div>

Vanilla Three.js: size the renderer to the container, not always window — use ResizeObserver or container clientWidth / clientHeight.


R3F Canvas Baseline

import { Canvas } from '@react-three/fiber';
import { OrbitControls, Environment } from '@react-three/drei';

export function Scene() {
  return (
    <div style={{ height: '500px', width: '100%' }}>
      <Canvas shadows dpr={[1, 2]} camera={{ position: [0, 0, 5], fov: 45 }}>
        <Environment preset="city" />
        <ambientLight intensity={0.4} />
        <directionalLight position={[5, 5, 5]} castShadow />
        <Mesh />
        <OrbitControls enableDamping />
      </Canvas>
    </div>
  );
}

Set tone mapping and output color space on the renderer for PBR that is not flat — see 3d-web-experiences → renderer baseline.


Hooks & Imports (common bugs)

import { useRef, useState } from 'react';
import { useFrame } from '@react-three/fiber'; // NOT from 'react'
import type { Mesh } from 'three';

function AnimatedBox() {
  const ref = useRef<Mesh>(null);
  useFrame((_, delta) => {
    if (ref.current) ref.current.rotation.y += delta;
  });
  return (
    <mesh ref={ref}>
      <boxGeometry />
      <meshStandardMaterial />
    </mesh>
  );
}
Mistake Fix
useFrame from react Import from @react-three/fiber
<Detail> from three Use drei <Detailed distances={[0, 10, 20]}> with child meshes
InstancedMesh from fiber Use JSX <instancedMesh>; Object3D from three

Read the full file on GitHub · 157 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 157 lines · 0 tokens per session scan A 9f9721fe0ff4

Subscribe to this mod's changes

3d-graphics is a cursor rule published in the GitHub repository madebyaris/advance-minimax-m3-cursor-rules (125 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,153 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.