Author Message
ufoace

Joined: 11 Mar 2013
Posts: 46

Posted: Fri May 10, 2013 1:32 am    Post subject: How to make a spiky ball, and other pointy things?

I was just trying to make some mountains on a round world using ISO surface, with some mountains on it, although I always get round mountains, and I wish to have pointy ones, I wish to know tricks for pointy shapes of all kinds because I think they look nice.

This formula makes very round hills:

 Code: var earth = x*x+y*y+z*z -1; //sphere    var nz = 3dnoise(x*3,y*3,z*3+54)*.2;       return -earth+ nz;

so I tried this trick to make the 3d noise intensity gradient exponential:
 Code: var earth = x*x+y*y+z*z -radius; //sphere    var nz = ngn(x*3,y*3,z*3+54)*2;            nz = (nz*nz*nz*nz*nz*nz*nz)*0.0051;       return -earth+ nz;

Although it still looks round!
I would love to know how to make shapes like this:
http://4.bp.blogspot.com/_VSCqsrRkUWU/S8r2gm_FIBI/AAAAAAAAAFY/YBitaxC4LRg/s1600/Pollen.jpg

what is the mathematical principle for achieving pointy surfaces with convex edges? why are isosurfaces almost always round style?

edit - actually i managed to make abit pointy hills on the planet using math.abs...
 Code: var nz = Mathf.Abs(3dnoise(x*3,y*3,z*3))*.3;
abdelhamid belaid

Joined: 13 Aug 2009
Posts: 170

Posted: Fri May 10, 2013 4:28 pm    Post subject:

isosurfaces are almost always round style because we usually use differentiable functions (cos, sin, ax+b, x^2, x^3......), we can get pointy shapes using "abs" function for example:

this is an example (on a plane):
 Code: Name: AB_mountains1 F(): z- 4/(1+4*sqrt((x-0.3)^2+y*y))^2 - 3/(1+4*sqrt((x-2)^2+y*y))^2 - 3/(1+4*sqrt((x+3)^2+(y-3)^2))^3 - 5/(1+4*sqrt((x-1)^2+(y+2)^2)) - 2/(1+4*sqrt((x+2.7)^2+(y-2.6)^2)) [x]: -4 , 4 [y]: -4 , 4 [z]: -0.1 , 5.5 ; I mean: z - sum(  h_i/(1+(c_i*sqrt((x-a_i)^2+(y-b_i)^2)))^n_i   ) =0

I'm not sure if this can help ?, anyway we can make it more realistic and of course on a sphere, it's just a beginning.
_________________

Last edited by abdelhamid belaid on Sun May 12, 2013 2:36 pm; edited 1 time in total
abdelhamid belaid

Joined: 13 Aug 2009
Posts: 170

Posted: Sat May 11, 2013 12:05 am    Post subject:

this is a pointy sphere:
 Code: Name: AB_pointysphere1 F(): sqrt(x*x+y*y+z*z)-3 -1/(1+5*sqrt(sin(6*atan2(sqrt(y^2+z^2)*cos(atan(sin(6*atan2(z,y)))/6),x))^2/36 +atan2(sqrt(y^2+z^2)*sin(sin(6*atan2(z,y))/6)  , sqrt(x*x+(sqrt(y^2+z^2)*cos(sin(6*atan2(z,y))/6))^2))^2))^7 [x]: -4 , 4 [y]: -4 , 4 [z]: -4 , 4 ;

_________________

Last edited by abdelhamid belaid on Sun May 12, 2013 2:34 pm; edited 1 time in total
jotero

Joined: 27 Jan 2007
Posts: 153
Location: Germany Hannover

Posted: Sat May 11, 2013 5:40 pm    Post subject:

abdelhamid belaid wrote:
this is a pointy sphere:
 Code: F(): sqrt(x*x+y*y+z*z)-3 -1/(1+5*sqrt(sin(6*atan2(sqrt(y^2+z^2)*cos(atan(sin(6*atan2(z,y)))/6),x))^2/36+atan2(sqrt(y^2+z^2)*sin(sin(6*atan2(z,y))/6) , sqrt(x*x+(sqrt(y^2+z^2)*cos(sin(6*atan2(z,y))/6))^2))^2))^7 [x]: -4 , 4 [y]: -4 , 4 [z]: -4 , 4

very good work abdelhamid
_________________
Kontakte
abdelhamid belaid

Joined: 13 Aug 2009
Posts: 170

Posted: Sun May 12, 2013 2:27 pm    Post subject:

thanks Torolf

I think we have Mojave Desert now (unlimited surface with repetition of mountains) :
 Code: Name: AB_mountains2 F(): z- 4/(1+4*sqrt((sin(x/3)*3-0.3)^2+(sin(y/3)*3)^2)*(1+0.1*cos(6*atan2(sin(y/3)*3,sin(x/3)*3))) )^2- 3/(1+4*sqrt((sin(x/3)*3-2)^2+(sin(y/3)*3)^2)*(1+0.1*cos(6*atan2(sin(y/3)*3,sin(x/3)*3-1.8)))*(1+exp(-z)+sin(3*z)/5)  )^2- 3/(1+2*sqrt((sin(x/3)*3+2)^2+(sin(y/3)*3-2)^2))^3- 5/(1+4*sqrt((sin(x/3)*3-1)^2+(sin(y/3)*3+2)^2))- 2/(1+4*sqrt((sin(x/3)*3+1.7)^2+(sin(y/3)*3-1.6)^2)) [x]: -12.4 , 12.4 [y]: -10.5 , 10.5 [z]: -0.1 , 5.5 ;

_________________
ufoace

Joined: 11 Mar 2013
Posts: 46

 Posted: Fri May 17, 2013 12:33 pm    Post subject: Oh Wow! that's amazing! i was working so much i forgot to see this for a week. Thanks Abdelhamid, i will study and see what i may develop from it.
abdelhamid belaid

Joined: 13 Aug 2009
Posts: 170

Posted: Fri May 17, 2013 2:00 pm    Post subject:

I've forgotten too, for a pointy sphere you would write:
 Code: z - sum(  h_i/(1+(c_i*sqrt((atan2(y,x)-a_i)^2+(atan2(z,sqrt(x^2+y^2))-b_i)^2)))^n_i   ) =0

an example:
 Code: Name: AB_pointysphere2 F(): sqrt(x^2+y^2+z^2) - 3 -2/(1+4*sqrt((atan2(y,x)-pi/6)^2+(atan2(z,sqrt(x^2+y^2))+pi/8)^2/4))^4 -2/(1+4*sqrt((atan2(y,x)-pi/6)^2+(atan2(z,sqrt(x^2+y^2))-pi/8)^2/4))^4 -1/(1+4*sqrt((atan2(y,x)-pi/2)^2+(atan2(z,sqrt(x^2+y^2))-0)^2/2))^3 -1/(1+38*((atan2(y,x)-pi/3)^2+(atan2(z,sqrt(x^2+y^2))-pi/10)^2))^2/2 -1/(1+38*((atan2(y,x)-pi/3)^2+(atan2(z,sqrt(x^2+y^2))+pi/10)^2))^2/2 [x]: -4 , 4 [y]: -4 , 4 [z]: -4 , 4 ;

_________________
ufoace

Joined: 11 Mar 2013
Posts: 46

 Posted: Tue May 21, 2013 5:31 am    Post subject: Haha that is sweet. i am going to try rotational symmetry today.
Furan

Joined: 05 Oct 2010
Posts: 64
Location: Prague, Czech Republic

 Posted: Tue May 21, 2013 10:08 am    Post subject: For mountains and other natural fenomena use the Perlin noise: http://www.bugman123.com/Fractals/index.html If you want a xeno-style pointy mountain terrain, you could use the original pointy function mentioned before F=(fx,fy), where fx=fx(x,y) fy=fy(x,y) are two different wave functions. fx=0 and fy=0 should form series of curves that cross each other in random places. These crossings would form spikes. You could use another function to control the height of the spikes or use grad(fx) and grad(fy). These spikes will not be circular in cross section. I think there could be a way to fix that partialy, if you need to, by using gradient vectors of fx and fy, checking their angle and adding some corrections accordingly. This is only a wild guess, I'm not sure this would work.
ufoace

Joined: 11 Mar 2013
Posts: 46

 Posted: Wed May 22, 2013 8:13 am    Post subject: Hi there, in 2d planes with vertex displacement, i have used alot of noise from libnoise, and explored many functions for making spikes. with periodic functions, i.e. 1-abs(sin(x)) , it is possible to coincide the spikes to form round mountains, and with noise, it's ok although it forms ridges... same with isosurface 3d noise, i managed to get some quite nice pointy ridges using abs of 3d noise here's a video of some research into irregular spikes using parametric: http://www.youtube.com/watch?v=IWXkxMXZoDo with some random music that was playing on my 100 channel internet radio playlist here is the isofield attempt with abs noise... its already great to have some points at all.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum MathMod----------------MathMod Progress & featuresMathematical Models CollectionHow toBugsMathMod for WindowsMathMod for Linux/UnixMathMod For MACOSXMathMod TutorialsOther Mathematical ToolsOpen Discussion K3DSurf----------------K3DSurf Discuss/DiscussionsHow toK3DSurf math related questionsK3DSurf for WindowsK3DSurf for MacOSK3DSurf for LinuxOnline K3DSurf: J3DSurfNewsBugsOnline DocumentationAccount Activation Issue ?/ Problème d'activation de votre compte ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum