O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Graphing a function in three dimensions

This last recipe in the chapter is probably also the most advanced in the entire book, but it can be used to create an impressive effect.

In this recipe, we define our own generated 3D object, not based on cubes or other existing shapes. To obtain this result, we define a very basic geometry that we used to build a custom shape.

Getting ready

The starting setup is similar as before. We will define a new class to hold our graph. So copy any of the previous recipes, but remove all references to Graph3D and the data from it.

How to do it...

The idea here is to plot a three-dimensional function:

y = (sin(x)² . cos(z)²) / (5 . x² . z²)

  1. We will use Flash's built-in Vector3D class to clean up some of the code. Vector3D ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required