Scirra / Construct-feature-requests

A place to submit feature requests and suggestions for Construct.
https://www.construct.net
11 stars 1 forks source link

[Missing ACE] MeshPointX/Y/ZAt(column, row) expression #97

Open TackerTacker opened 8 months ago

TackerTacker commented 8 months ago

Reviewed guidelines

Checked for duplicate suggestions

Summary

I need to get the X/Y/Z position of mesh points.

Possible workarounds or alternatives

I could add an Array to the sprite and input every single X,Y,Z coordinate of every point in the mesh by hand, but this is incredibly tedious and error prone, and it would be on top of the already very tedious process of creating meshes in the editor. I find this workflow unsustainable for an actual project and was the reason why I dropped it.

Proposed solution

My suggestion is to add an MeshPointX/Y/ZAt( column, row ) expression to get the position of mesh points. Just like the Sprite.PolyPointX/YAt( index ) expression we already have for collision poly points.

grafik

Why is this idea important?

I want to create sprites with meshes, model them into certain shapes in the editor and apply some slight random offsets to some of the mesh points in code to add some visual interest.

Another thing I want to do is move mesh points based on nearby explosions, for that I need to check if mesh points of objects near the explosions are a certain distance away from that explosion.

Additional remarks

Third time's a charm

F3der1co commented 7 months ago

Another use case where these would be extremely useful and I would instantly use it for: Doing a Z collision response, using a mesh z for some terrain etc. If I could get the z of a point I could get the nearest points (remap the width and hight with meshSize) and calculate the correct z elevation at that position.