[][src]Struct three::Mesh

pub struct Mesh { /* fields omitted */ }

Geometry with some Material.

Examples

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]);

Notes

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

Methods

impl Mesh
[src]

Set mesh material.

Bind a skeleton to the mesh.

Trait Implementations

impl Object for Mesh
[src]

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
[src]

impl PartialEq<Mesh> for Mesh
[src]

impl Clone for Mesh
[src]

Performs copy-assignment from source. Read more

impl Eq for Mesh
[src]

impl AsRef<Base> for Mesh
[src]

impl Debug for Mesh
[src]

impl Hash for Mesh
[src]

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
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 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
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 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
[src]

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Erased for T