Away3d Plane Primitive not being mediated by Robotlegs:(

Danny's Avatar

Danny

08 Jun, 2011 01:39 AM

Hi guys, hoping someone could shed a light into this. I have a simple Away3d scene which creates a bunch of Planes in 3d space. My Away3d scene extends Sprite and contains all code necessary to run the 3d scene ( camera creation, viewport, rendering loop, etc..). Now this class is properly being mediated by Robotlegs currently. My issue is with the planes the 3d scene is creating. It just will not mediate my planes. I've checked my mappings and made sure everything was connected properly but the mediator just doesn't register. I created a custom class that extends Plane. Now I want an image to be applied to each plane when each plane is registered for mediation. This is where it stops working. I can see the planes being generated on-screen but mediator fails.

Just to confirm I have created one class extending the away3d Plane primitive, one class that mediates this plane, and on my context class I map my new Plane class to the mediator. This is pretty much it. Am I missing something? Hope someone can help:/

  1. 1 Posted by matt on 08 Jun, 2011 08:55 AM

    matt's Avatar

    i'm guessing an away3d plane is not a display object and therefore does not explicitly get added to the stage, which is the point where automatic mediation will occur - you would therefore have to manually create the mediator when you create the plane - i've never done this but i think it's along the lines of mediatorMap.createMediator(contextView);

    http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/how...

  2. 2 Posted by Danny on 09 Jun, 2011 03:21 AM

    Danny's Avatar

    I think I get you but I'm not sure where would be the appropiate place to call that method? Since my planes are being generated within my Away3d scene how could I access the context class to call the createMediator method? I'm not sure how I can reference the context unless maybe I target the stage? How do you think I should do it?

  3. 3 Posted by matt on 09 Jun, 2011 07:26 AM

    matt's Avatar

    yeah i'm not sure about that one. but i am intrigued as to why you want to mediate individual planes? i would suggest that your already mediated Away3d scene could perhaps be responsible for assigning materials to the planes it creates?

  4. 4 Posted by Danny on 09 Jun, 2011 02:47 PM

    Danny's Avatar

    Well thing is that the planes will have a few things going on with the materials and will have buttons inside and things like that and so I figured it being a view and relatively complex it should be mediated. I need the planes code decoupled from the material's code since the materia's wll be swapped out on the fly so I figured it would help to take advantage of Robot Legs to do this by having the Plane as one view and the sprites used for a material as another view. I am very new to Robot Legs so I'm not sure if this is the best approach though. Maybe there is a better way?

  5. 5 Posted by Weyert on 10 Jun, 2011 07:50 AM

    Weyert's Avatar

    The problem is that the plane is a Object3D instance which doesn't exist on the stage. You would need to make your custom mediatorMap implementation which detects when the scene changes and maybe based on then mediate the Object3D class.

  6. 6 Posted by Danny on 10 Jun, 2011 06:17 PM

    Danny's Avatar

    Weyert, would you know where I need to create the custom implementation? That's kinda what has me stuck right now. I understand what needs to be done in theory but I don't know where I would map it if it needs to be inside my away3d view or somewhere else?

  7. Support Staff 7 Posted by Stray on 10 Jun, 2011 06:26 PM

    Stray's Avatar

    Hi Danny,

    if you haven't done so already, check out this blog post:

    http://www.paultondeur.com/2011/03/07/robotlegs-away3d-4-broomstick...

    It's all about combining Away3D and Robotlegs, and it includes links to his github libraries of away3D/robotlegs hybrids (such as Mediator3D which I think is what you need here).

    Stray

  8. 8 Posted by patrickwilson.t... on 21 Sep, 2011 03:50 AM

    patrickwilson.tv's Avatar

    Stray,

    Paul Tondeur's utility for using Away3D with v.4.0 looks great and I look forward to using it on a Stage3D project. However, I'm currently restricted to using v.3.6 on a project and was wondering if there is a solution out there for working with Robotlegs and that version of Away3D? It looks like it may be possible to modify the codebase to use Scene3DEvent to dispatch an event when a 3D object is added to the scene but after trying this I was still unable to achieve mediation on my Plane primitives. Are you aware of any situation where this has been achieved?

    Thanks!

  9. Ondina D.F. closed this discussion on 23 Dec, 2011 08:52 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac