How to make a spiky ball, and other pointy things?

 
Post new topic   Reply to topic    K3DSurf forum Forum Index -> Mathematical Models Collection
View previous topic :: View next topic  
Author Message
ufoace



Joined: 11 Mar 2013
Posts: 46

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

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;   
Back to top View user's profile Send private message
abdelhamid belaid



Joined: 13 Aug 2009
Posts: 170

PostPosted: Fri May 10, 2013 4:28 pm    Post subject: Reply with quote

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.
_________________
My YouTube channel


Last edited by abdelhamid belaid on Sun May 12, 2013 2:36 pm; edited 1 time in total
Back to top View user's profile Send private message Send e-mail Visit poster's website
abdelhamid belaid



Joined: 13 Aug 2009
Posts: 170

PostPosted: Sat May 11, 2013 12:05 am    Post subject: Reply with quote

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
;



_________________
My YouTube channel


Last edited by abdelhamid belaid on Sun May 12, 2013 2:34 pm; edited 1 time in total
Back to top View user's profile Send private message Send e-mail Visit poster's website
jotero



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

PostPosted: Sat May 11, 2013 5:40 pm    Post subject: Reply with quote

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 Very Happy
_________________
Kontakte
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address
abdelhamid belaid



Joined: 13 Aug 2009
Posts: 170

PostPosted: Sun May 12, 2013 2:27 pm    Post subject: Reply with quote

thanks Torolf Smile

I think we have Mojave Desert now (unlimited surface with repetition of mountains) Smile:
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
;



_________________
My YouTube channel
Back to top View user's profile Send private message Send e-mail Visit poster's website
ufoace



Joined: 11 Mar 2013
Posts: 46

PostPosted: Fri May 17, 2013 12:33 pm    Post subject: Reply with quote

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.
Back to top View user's profile Send private message
abdelhamid belaid



Joined: 13 Aug 2009
Posts: 170

PostPosted: Fri May 17, 2013 2:00 pm    Post subject: Reply with quote

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
;


_________________
My YouTube channel
Back to top View user's profile Send private message Send e-mail Visit poster's website
ufoace



Joined: 11 Mar 2013
Posts: 46

PostPosted: Tue May 21, 2013 5:31 am    Post subject: Reply with quote

Haha that is sweet. i am going to try rotational symmetry today. Smile
Back to top View user's profile Send private message
Furan



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

PostPosted: Tue May 21, 2013 10:08 am    Post subject: Reply with quote

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.
Back to top View user's profile Send private message Visit poster's website
ufoace



Joined: 11 Mar 2013
Posts: 46

PostPosted: Wed May 22, 2013 8:13 am    Post subject: Reply with quote

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 Razz

here is the isofield attempt with abs noise... its already great to have some points at all.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    K3DSurf forum Forum Index -> Mathematical Models Collection All times are GMT
Page 1 of 1

 
Jump to:  
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


2005 Powered by phpBB © 2001, 2005 phpBB Group


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com