Logo by bib - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. April 19, 2024, 09:24:21 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Revolve a 2D XY function around Z?  (Read 816 times)
0 Members and 1 Guest are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« on: November 14, 2015, 03:36:00 PM »

Hey,

I got a simple maths problem, but can't seem to have brainpower to solve it quickly.

Let's assume we have some function like IQ impulse or so.


Now I want to use it to create a 3D function by revolving the shape around Z (vertical) axis.
So essentially I want to use it as a shape for a lathe object.


That should be simple.
Any hints?
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #1 on: November 14, 2015, 04:46:00 PM »

Nevermind - easier than I thought.
Code:
// Cubic pulse 1D 
float cubicPulse( float c, float w, float x ){
x = abs(x - c);
if(x>w) return 0.0;
x /= w;
return 1.0 - x*x*(3.0-2.0*x);
}

// Cubic pulse 2D
float cubicPulse2D(vec2 z, vec2 c, float w, float o){
z = abs(z+c);
float r = length(z);
float h = cubicPulse(o, w, r);
return h;
}
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #2 on: November 14, 2015, 07:01:39 PM »

So the above works, but I have no idea how can I scale it non-uniformly, so that it gives me an elongated shape based on the vec2 w scales.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
from image to function General Discussion A.Real 13 5074 Last post November 07, 2006, 07:26:14 AM
by lycium
Search function Discuss Fractal Forums cbuchner1 4 952 Last post December 29, 2009, 11:21:12 PM
by Nahee_Enterprises
Any function you like.... Theory David Makin 5 2012 Last post December 18, 2009, 11:16:48 PM
by David Makin
Function of Reality Images Showcase (Rate My Fractal) alexl 1 1959 Last post April 03, 2012, 04:32:51 AM
by weavers
Please help recursive function Discuss Fractal Forums kevinmorais 4 560 Last post January 25, 2013, 11:59:39 AM
by AtomicZagnut

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.178 seconds with 25 queries. (Pretty URLs adds 0.012s, 2q)