用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ming1zhou88/minemap-skills --skill minemap-primitives-and-materials命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | minemap-primitives-and-materials |
| description | MineMap Primitive 体系、几何与材质组合、PointPrimitiveCollection 与渲染顺序控制。 |
const matrix = minemap.Transforms.cartographicToFixedFrame(new minemap.Math.Vector3(116.39, 39.9, 0));
const geometry = new minemap.Geometries.ConeGeometry({
radiusBottom: 60,
height: 100,
radialSegments: 36
});
const primitive = new minemap.Primitive({
id: "cone-1",
modelMatrix: matrix,
geometry,
material: minemap.StandardMaterial.fromType("Color", { color: "green" })
});
map.addPrimitive(primitive);
Primitive = geometry + material (+ modelMatrix),适合自定义渲染对象。
常见几何:
BoxGeometry / SphereGeometry / ConeGeometryPolylineGeometry / WallGeometryRegionGeometry / FenceGeometry常见材质:
StandardMaterialPhongMaterialLambertMaterialPhysicalMaterialWaterMaterial使用 PointPrimitiveCollection 管理大量点对象,优于单独创建大量离散 primitive。
addPrimitive(primitive)removePrimitive(primitive)removePrimitiveById(id)getPrimitiveById(id)source/index.js 公开了比“几何 + 材质”更低一层的资源对象:
TextureLoader、TextureCubeLoader、Texture、TextureCubeBasicMaterial、MirrorMaterial、BillboardMaterial、GradientColorBoxMaterialTubeGeometry、LocalPolylineGeometry、FrustumGeometry、FrustumOutlineGeometry、RadarHemisphereGeometryAmbientLight、SunLight、DirectionalLight、PointLight、SpotLight这些对象仍然属于同一低层渲染面:只有在图层和 scene component 都不合适时再使用。
const p = new minemap.PointPrimitive({
position: minemap.Math.Vector3.fromDegrees(116.39, 39.9, 20),
pixelSize: 10,
color: "red"
});
const pc = new minemap.PointPrimitiveCollection({
id: "points",
pointPrimitives: [p],
allowPick: true
});
map.addPrimitive(pc);
透明对象冲突时,可调整图元顺序(按引擎提供的 primitive 顺序控制接口),避免视觉覆盖异常。
const texture = minemap.TextureLoader.load({
map,
texUrl: "../image/uv.jpg"
});
const material = new minemap.StandardMaterial({
baseColorMap: texture
});
经验规则:
loadTextureCubeLoader公开光照类是有效开发面,但它们通常是 primitive / 自定义对象渲染链的补充,不是普通底图业务的第一入口。
minemap-2d-3d-overlay-and-classificationminemap-transformsminemap-math-foundationsminemap-lighting-and-shadowsminemap-material-system-and-shadingminemap-primitive-adapt-terrainminemap-screen-space-reflectionminemap-water-surface-and-refractionminemap-scene-componentsminemap-events-and-picking基于 SOC 职业分类