Graphing an oblique circular cone.

  • Thread starter Ostsol
  • Start date
  • #1
12
0

Main Question or Discussion Point

I have recently experimented with algorithms for rendering colour gradients. Linear gradients are no problem, but radial gradients have proved to be somewhat more difficult. A radial gradient focused at the centre is simply a matter of measuring the distance of a pixel from the centre and comparing it to the radius of the gradient. I found that the most elegant solution was to represent the gradient as an inverted cone of height 1.0. This way, with a single equation I can discover the ratio with which to interpolate colours. I used the following quadric surface equation:

[itex]\frac{x^{2}}{a^{2}} + \frac{y^{2}}{b^{2}} - \frac{z^{2}}{c^{2}} = 0[/itex]

Solving for z, I get the ratio.

The problem is that this works only for right circular or elliptical cones. If the apex is not above the centre, as with an oblique cone, this equation will not help me. I need this because a radial gradient's focus need not be at its centre. I can discover the ratio via a line-circle intersection, but I feel that representing the gradient as an oblique cone would be more elegant and probably more efficient. Unfortunately, I cannot find any information on how one might graph such a cone and my math education is limited to introductory single-variable calculus -- and that was over a decade ago. As such, deriving the correct equation myself is beyond me.

Can anyone help me find such an equation, assuming one exists?

I have attached an example of the kind of radial gradient I would like to reproduce.
 

Attachments

Answers and Replies

  • #2
12
0
I've come to the conclusion that an oblique circular cone is merely a right elliptical cone. The bottom of the oblique cone is a conic section that is inclined such that the ellipse is now a circle. Unfortunately, this doesn't help me much, as I'm sure that rotating a quadric surface involves some very complex math.
 

Related Threads on Graphing an oblique circular cone.

  • Last Post
Replies
6
Views
2K
Replies
1
Views
2K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
3
Views
4K
Replies
5
Views
11K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
11
Views
1K
Replies
3
Views
24K
Top