Utterly, utterly basic question about using filters

Software: Away3D 4.x

Drumbo, Newbie
Posted: 12 April 2012 08:32 PM   Total Posts: 17

I can’t for the life of me work out how to use them, or which classes they apply to. Is it the view? The scene? The camera? Individual objects? Are there any articles on this that I could read?

I’d just like to play around with them and see what I can achieve.

Thanks in advance!

   

ASWC, Member
Posted: 13 April 2012 12:54 AM   Total Posts: 76   [ # 1 ]

The 3dfilters? They apply to the view:

view.filters3d [my3dfilter];//pass filters in array 

I don’t find them very useful for now cos they are more for complete screen effect and not individual mesh effect.

   

Drumbo, Newbie
Posted: 13 April 2012 09:10 AM   Total Posts: 17   [ # 2 ]

Thanks for that, I’ll have a play.

With regards to writing filters that apply to some meshes rather than every mesh, It’s looking increasingly like I’m going to need to get my hands dirty and learn GLSL though smile

   

3dNewb, Sr. Member
Posted: 13 April 2012 12:16 PM   Total Posts: 105   [ # 3 ]

I can only advise you to go and learn AGAL. It is very nicely integrated into Away3D and you can be up-and-running with some basic shaders in no-time (after you get passed the learning curve of AGAL in general)

   

Drumbo, Newbie
Posted: 15 April 2012 02:02 PM   Total Posts: 17   [ # 4 ]

view.filters3d = [my3dfilter];//pass filters in array

Doesn’t work, I’m sorry! Here’s what I wrote:

view = new View3D(scene, camera);
var filter:DepthOfFieldFilter3D = new DepthOfFieldFilter3D(3, 3);
view.filters3d = [filter];

This outputs an error:

[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.

I’m sure there’s something obvious that I’m getting wrong here

   

ASWC, Member
Posted: 15 April 2012 04:21 PM   Total Posts: 76   [ # 5 ]

your scene or camera is null.

   

Avatar
kurono, Sr. Member
Posted: 16 April 2012 07:35 PM   Total Posts: 103   [ # 6 ]

Sometimes view3d isn’t initialized when you try to set filters. Try the following workaround in your OnEnterFrame callback:

if (view{
    
if (!view.filters){
        view
.filters3d [filter];
    
}
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X