Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce point picking selection mode for ray and cone #259

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bpostlethwaite
Copy link

@bpostlethwaite bpostlethwaite commented Nov 13, 2023

Hello @kaveh808 and thanks for the kons-9 project. I'm building a wavetable synth editor, so basically 3D height-field transformations that will be used in audio oscillators. As part of the editor I want dynamic mouse-driven point-and-click editing such as increasing height and decreasing height when mouse is clicked. Similar to the terrain builder mechanics in simulation games.

To accomplish this with kons-9 I have added point selection within the current shape selection machinery. Now, a custom selection handler can trigger an action like transforming the region around the selected point. I have provided a simple example that draws a sphere at the closest clicked point.

The code adds a very small fixed cost to object selection, most of the calculations for finding the closest vertex to the ray or cone was already there. Only a few basic vec operations to get the closest vertex point were necessary.

I've made the changes in a backwards compatible way. If *point-picking-enabled* is not set to t then the selection handlers are called with the previous keyword arguments. If it set to t however, the selection handler is expected to contain an additional keyword argument for xs-point (which is a list of the closest picked vertex for the list of selected shapes).

@aykaramba
Copy link

Just a user here, this sounds amazing. Also, I can't wait to try out your synth editor when that becomes available, that sounds fun!

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

Successfully merging this pull request may close these issues.

2 participants