Title: help - round rectangle - for metaballs... Post by: cKleinhuis on September 12, 2013, 01:45:59 PM hello, i know you can help me, for a decent metaball visualisation (just in 2d ) i want to visualise the balls
as rounded rectangles, the standard distance function for the metaballs uses sqrt(distx^2+disty^2) to create the shape of circles, but i would like to have rounded rectangles instead, anyone has a round rectangle distance function handy for me ?! :) Title: Re: help - round rectangle - for metaballs... Post by: lkmitch on September 12, 2013, 05:42:52 PM Use (distx^n + disty^n)^(1/n) for larger values of n. 4 or 6 may work.
Title: Re: help - round rectangle - for metaballs... Post by: cKleinhuis on September 12, 2013, 07:16:57 PM Ah right its that simple, will check it out!!
Title: Re: help - round rectangle - for metaballs... Post by: Roquen on September 13, 2013, 11:10:14 AM Let me know if you need this explained.
Code: #ifdef GL_ES Title: Re: help - round rectangle - for metaballs... Post by: jehovajah on October 07, 2013, 09:07:23 AM Cool, De Fermat's last theorem applied ! Make sure you use even numbers. If n is very large you may get a perfect square, so play around with the range. |