Skip to content

Mesh support#50

Merged
hecrj merged 7 commits into
masterfrom
feature/mesh
Jun 13, 2019
Merged

Mesh support#50
hecrj merged 7 commits into
masterfrom
feature/mesh

Conversation

@hecrj

@hecrj hecrj commented Jun 12, 2019

Copy link
Copy Markdown
Owner

Mesh example
Watch in higher quality / Code

Fixes #4 and closes #32.

This PR introduces the Shape and Mesh types.

  • A Shape represents a geometric figure.
  • A Mesh is a set of shapes that can be drawn.

The API is quite simple!

let shape = Shape::Circle {
    center: Point::new(0.0, 0.0),
    radius: 100.0,
};

let mut mesh = Mesh::new();

mesh.stroke(shape.clone(), Color::BLACK, 2);
mesh.fill(shape, Color::WHITE);

mesh.draw(target);

@hecrj hecrj added the feature New feature or request label Jun 12, 2019
@hecrj hecrj added this to the 0.3.0 milestone Jun 12, 2019
@hecrj hecrj mentioned this pull request Jun 12, 2019
@JohnDoneth

Copy link
Copy Markdown
Contributor

Wow, this is awesome! 🎉

This is just what I wanted to use when prototyping some simple game concepts. I can see this also being useful for debug drawing for something like physics bodies.

@hecrj hecrj merged commit c31dc9f into master Jun 13, 2019
@hecrj hecrj deleted the feature/mesh branch June 14, 2019 10:04
@hecrj hecrj self-assigned this Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shape rendering support Mesh support

2 participants