Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

GeometricPrimitives (at least Planes) should allow changing size #363

Closed
guygodin opened this issue May 2, 2014 · 2 comments
Closed

GeometricPrimitives (at least Planes) should allow changing size #363

guygodin opened this issue May 2, 2014 · 2 comments

Comments

@guygodin
Copy link

guygodin commented May 2, 2014

The GeometricPrimitive is very useful for drawing planes or spheres but they would be a lot more powerful if we were able to change their size (through a property) without having to create another instance of the object.

@xoofx
Copy link
Member

xoofx commented May 2, 2014

This is usually not done like this. GeometricPrimitives are immutable data because they better fit the way the GPU is optimized for them. Usually if you need dynamic scenario for modifying vertices, you can either implement the resize logic in a custom vertex shader with a World/Object Matrix that can scale the object (so that the initial vertex buffer doesn't change). You can do that basically with a BasicEffect with a specific World matrix.
For other dynamic requirements (list of vertices changing often...etc.), they are too specific to be generalized but the API provides a way to create your custom vertex/index dynamic buffer...etc.

So sorry, GeometricPrimitives should stay immutable.

@xoofx xoofx closed this as completed May 2, 2014
@guygodin
Copy link
Author

guygodin commented May 2, 2014

Got it, that makes sense.
Thanks

On May 2, 2014, at 12:15 AM, "Alexandre Mutel" notifications@github.com wrote:

This is usually not done like this. GeometricPrimitives are immutable data because they better fit the way the GPU is optimized for them. Usually if you need dynamic scenario for modifying vertices, you can either implement the resize logic in a custom vertex shader with a World/Object Matrix that can scale the object (so that the initial vertex buffer doesn't change). You can do that basically with a BasicEffect with a specific World matrix.
For other dynamic requirements (list of vertices changing often...etc.), they are too specific to be generalized but the API provides a way to create your custom vertex/index dynamic buffer...etc.

So sorry, GeometricPrimitives should stay immutable.


Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants