simple for most but driving me insane (primitives) Solved

Software: Away3D 4.x

parele, Jr. Member
Posted: 22 August 2012 02:35 PM   Total Posts: 43

I’m trying to add a video to a Cylinder, i can do this on a plane with no problems, i understand the logic but i cant manage to get a cylinder in my 3d container always errors!.var file = “testbg.flv”;

var videoTexture = new VideoTexture(file,512,512,true,true);

var textureMaterial = new TextureMaterial(videoTexture);

var _film = new CylinderGeometry(textureMateria,300,100,100,true);

_container.addChild(_film) //

this is wrong but i would like help how to get this to work, i have look at the documentation and examples online but they refer to the 3.6 not the current version..
Thanks

Solved i needed to add the mesh.

   

Avatar
Alexander Seifert, Moderator
Posted: 22 August 2012 06:20 PM   Total Posts: 129   [ # 1 ]

Primitives have change in the way they are created. They now extend Geometry, which by itself does not have a material and can not be added as a child to an ObjectContainer3D.

Take a look at the CylinderGeometry class and scroll down to the very end of the file. You’ll find the constructor and will see what arguments you need to use.

But what about material and how to add to _container?
Use a Mesh like this:

var _film:Mesh = new Mesh(new CylinderGeometry(300,100,100,true), textureMaterial);
_container.addChild(_film); 

The same applies for all other primitives. Are you sure you’re using the most recent Gold version of Away3D?

Cheers!

 Signature 
signature_image

http://www.deltastrike.org

   

parele, Jr. Member
Posted: 22 August 2012 06:40 PM   Total Posts: 43   [ # 2 ]

the line below was the problem:

var _film = new CylinderGeometry(textureMaterial,300,100,100,true); 

textureMaterial it was using this as a size, surprised it didn’t throw an error? so it was too large to render, but i worked it out i got my movie playing on a cylinder…

iv got the latest away3d using it with trial flash CS6, not familiar with any others…

learning away3d has its moments….

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X