MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / setupThinGeometry

Function setupThinGeometry

examples/renderer-test/main.ts:438–476  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

436// the hardest temporal stability test.
437
438function setupThinGeometry(): void {
439 const cx = -25.0;
440 const cz = -25.0;
441
442 // Ground
443 placeCube(cx, -0.05, cz, 20, 0.1, 16, 0.3, 0.3, 0.32, 0.5, 0.0);
444
445 // Vertical fence posts
446 for (let i = 0; i < 20; i = i + 1) {
447 const x = cx - 9.5 + i * 1.0;
448 placeCube(x, 1.0, cz - 5, 0.06, 2.0, 0.06, 0.35, 0.35, 0.38, 0.4, 1.0);
449 }
450
451 // Horizontal fence rail
452 placeCube(cx, 1.8, cz - 5, 20, 0.08, 0.08, 0.35, 0.35, 0.38, 0.4, 1.0);
453 placeCube(cx, 0.6, cz - 5, 20, 0.08, 0.08, 0.35, 0.35, 0.38, 0.4, 1.0);
454
455 // Diagonal bars (worst case for aliasing)
456 for (let i = 0; i < 12; i = i + 1) {
457 const x = cx - 5.5 + i * 1.0;
458 const node = createSceneNode();
459 attachModelToNode(node, cubeHandle, 0);
460 setSceneNodeColor(node, 0.6, 0.6, 0.62);
461 setSceneNodePbr(node, 0.3, 1.0);
462 setSceneNodeCastShadow(node, true);
463 setSceneNodeReceiveShadow(node, true);
464 let m = mat4Identity();
465 m = mat4Translate(m, { x: x, y: 1.5, z: cz + 2 });
466 m = mat4RotateY(m, 0.3 + i * 0.15);
467 m = mat4Scale(m, { x: 0.05, y: 3.0, z: 0.05 });
468 setSceneNodeTransform(node, m);
469 }
470
471 // Grid of very thin wires (subpixel test)
472 for (let i = 0; i < 30; i = i + 1) {
473 const x = cx - 7 + i * 0.5;
474 placeCube(x, 1.0, cz + 6, 0.02, 2.0, 0.02, 0.7, 0.7, 0.72, 0.2, 1.0);
475 }
476}
477
478// ============================================================
479// Ground plane & sky reference objects

Callers 1

main.tsFile · 0.85

Calls 12

createSceneNodeFunction · 0.90
attachModelToNodeFunction · 0.90
setSceneNodeColorFunction · 0.90
setSceneNodePbrFunction · 0.90
setSceneNodeCastShadowFunction · 0.90
mat4IdentityFunction · 0.90
mat4TranslateFunction · 0.90
mat4RotateYFunction · 0.90
mat4ScaleFunction · 0.90
setSceneNodeTransformFunction · 0.90
placeCubeFunction · 0.85

Tested by

no test coverage detected