[][src]Struct three::Mesh

pub struct Mesh { /* fields omitted */ }

Geometry with some Material.


Creating a solid red triangle.

let vertices = vec![
    [-0.5, -0.5, 0.0].into(),
    [ 0.5, -0.5, 0.0].into(),
    [ 0.5, -0.5, 0.0].into(),
let geometry = three::Geometry::with_vertices(vertices);
let red_material = three::material::Basic { color: three::color::RED, map: None };
let mesh = factory.mesh(geometry, red_material);

Duplicating a mesh.

use three::Object;
let mut duplicate = factory.mesh_instance(&mesh);
// Duplicated meshes share their geometry but may be transformed individually.
duplicate.set_position([1.2, 3.4, 5.6]);

Duplicating a mesh with a different material.

let yellow_material = three::material::Wireframe { color: three::color::YELLOW };
let mut duplicate = factory.mesh_instance_with_material(&mesh, yellow_material);
duplicate.set_position([1.2, 3.4, 5.6]);


  • Meshes are removed from the scene when dropped.
  • Hence, meshes must be kept in scope in order to be displayed.


impl Mesh

Set mesh material.

Bind a skeleton to the mesh.

Trait Implementations

impl Object for Mesh

The internal data for the object. Read more

Converts into the base type.

Invisible objects are not rendered by cameras.

Sets the name of the object.

Set both position, orientation and scale.

Set position.

Set orientation.

Set scale.

Set weights.

Rotates object in the specific direction of target.

impl DowncastObject for Mesh

impl PartialEq<Mesh> for Mesh

impl Clone for Mesh

Performs copy-assignment from source. Read more

impl Eq for Mesh

impl AsRef<Base> for Mesh

impl Debug for Mesh

impl Hash for Mesh

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Send for Mesh

impl !Sync for Mesh

Blanket Implementations

impl<T> From for T

impl<T, U> Into for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

impl<T, U> TryFrom for T where
    T: From<U>, 

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Erased for T