Tutorials refer to a primitive that doesn’t exist?

Software: Away3D 4.x

argoms, Newbie
Posted: 21 June 2013 08:33 PM   Total Posts: 1

Hi, I’ve just downloaded away3d to start experimenting with. I’ve never done any stuff in 3D before and have been looking up some basic tutorials.

What I’ve been finding is that every single tutorial (yes, for away3D version four and not three) refers to primitives with names such as “Sphere” or “Cube”. However, in the latest version (and oddly enough, the one linked to in a tutorial I was following that used “Cube”), there is no “Sphere” or “Cube”, only “SphereGeometry” and “CubeGeometry”. Simply changing Sphere for SphereGeometry leads to a lot of errors popping up, so it doesn’t seem to simply be a rename of the objects.

Since these objects and their geometry counterparts seem to be completely different, are there any updated tutorials that explain their usage? If not, what is the last version in which “Sphere” and “Cube” existed? Thanks in advance.

   

Avatar
Fabrice Closier, Administrator
Posted: 22 June 2013 08:00 PM   Total Posts: 1265   [ # 1 ]

Since 4.0 beta (+-2 years ago) you need for every mesh to define its geometry and material
var mesh:Mesh = new Mesh(new Geometry(), new ColorMaterial(0xFF0000));

Primitives are no longer meshes. They are geometries representing a sphere, plane, cube etc…

To build one you simply need to do declare a mesh with a dedicated primitive geometry:

var geometry:SphereGeometry = new SphereGeometry(params)
var sphere:Mesh = new Mesh(geometry, myMaterial);

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X