three#MeshPhongMaterial TypeScript Examples
The following examples show how to use
three#MeshPhongMaterial.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapHeightNode.ts From geo-three with MIT License | 6 votes |
/**
* Map height node constructor.
*
* @param parentNode - The parent node of this node.
* @param mapView - Map view object where this node is placed.
* @param location - Position in the node tree relative to the parent.
* @param level - Zoom level in the tile tree of the node.
* @param x - X position of the node in the tile tree.
* @param y - Y position of the node in the tile tree.
* @param material - Material used to render this height node.
* @param geometry - Geometry used to render this height node.
*/
public constructor(parentNode: MapHeightNode = null, mapView: MapView = null, location: number = MapNode.root, level: number = 0, x: number = 0, y: number = 0, geometry: BufferGeometry = MapHeightNode.geometry, material: Material = new MeshPhongMaterial({wireframe: false, color: 0xffffff}))
{
super(parentNode, mapView, location, level, x, y, geometry, material);
this.isMesh = true;
this.visible = false;
this.matrixAutoUpdate = false;
}
Example #2
Source File: MapMartiniHeightNode.ts From geo-three with MIT License | 6 votes |
public constructor(parentNode: MapHeightNode = null, mapView: MapView = null, location: number = MapNode.root, level: number = 0, x: number = 0, y: number = 0, {elevationDecoder = null, meshMaxError = 10, exageration = 1} = {})
{
super(parentNode, mapView, location, level, x, y, MapMartiniHeightNode.geometry, MapMartiniHeightNode.prepareMaterial(new MeshPhongMaterial({
map: MapMartiniHeightNode.emptyTexture,
color: 0xFFFFFF,
side: DoubleSide
}), level, exageration));
if (elevationDecoder)
{
this.elevationDecoder = elevationDecoder;
}
this.meshMaxError = meshMaxError;
this.exageration = exageration;
this.frustumCulled = false;
}
Example #3
Source File: App.tsx From THREE-CustomShaderMaterial with MIT License | 5 votes |
export default function App() {
const { Base } = useControls(
'Material',
{
Base: {
options: {
MeshPhysicalMaterial,
MeshBasicMaterial,
MeshMatcapMaterial,
MeshNormalMaterial,
MeshStandardMaterial,
MeshPhongMaterial,
MeshToonMaterial,
MeshLambertMaterial,
MeshDepthMaterial,
},
value: MeshPhysicalMaterial,
},
},
[]
)
return (
<>
<Leva />
<Tag />
<Canvas
gl={{
antialias: true,
}}
camera={{
position: [4, 4, 4],
}}
>
<color attach="background" args={['#ebebeb']} />
<Suspense fallback={null}>
{['MeshPhysicalMaterial', 'MeshStanderedMaterial'].includes(Base.name) ? (
<Environment preset="sunset" />
) : (
<Lights />
)}
</Suspense>
<Water base={Base} />
<ContactShadows
position={[0, -0.2, 0]}
width={10}
height={10}
far={20}
opacity={0.5}
rotation={[Math.PI / 2, 0, 0]}
/>
<Copy base={Base} />
<OrbitControls />
</Canvas>
</>
)
}
Example #4
Source File: MapMartiniHeightNode.d.ts From geo-three with MIT License | 5 votes |
material: MeshPhongMaterial;
Example #5
Source File: MapHeightNodeShader.ts From geo-three with MIT License | 5 votes |
public constructor(parentNode: MapHeightNode = null, mapView: MapView = null, location: number = MapNode.root, level: number = 0, x: number = 0, y: number = 0)
{
const material: Material = MapHeightNodeShader.prepareMaterial(new MeshPhongMaterial({map: MapHeightNodeShader.emptyTexture, color: 0xFFFFFF}));
super(parentNode, mapView, location, level, x, y, MapHeightNodeShader.geometry, material);
this.frustumCulled = false;
}
Example #6
Source File: MapMartiniHeightNode.ts From geo-three with MIT License | 5 votes |
public material: MeshPhongMaterial;
Example #7
Source File: Material.ts From trois with MIT License | 5 votes |
PhongMaterial = materialComponent('PhongMaterial', { props: { type: Object as PropType<PhongMaterialPropsInterface>, default: () => ({}) } }, (opts) => new MeshPhongMaterial(opts))