If I had my way I wouldn't use Robotlegs and especially not the PureMVC for any 3D projects. But it's not up to me it's the people that hire me and their developers which make this decision.
I was wondering the correct way to do this as I couldn't see any correct way to do it in these frameworks and decided to quiz some of you guys whom may/probably do have more of an understanding of these frameworks than I do and you all also know Away3D where as the people I've quizzed on the framework forums don't. I will create something along the lines of the list below in future projects where I am required to use Away3D and Robotlegs and other MVC frameworks: *view* [dir] > *ModuleName3DScene* [dir] * Away3DModuleNameEvents.as (event constants) * * Away3DModuleNameContext.as (mapViews to mediators and instantiate view components) Away3DModuleName.as (wont do much) Away3DModuleNameMediator.as * - init - Instantiate camera handler - Setup view, scene and camera - Instantiating other classes of 3D objects and adding them to the scene - Render handler via enter frame - Event handling of framework and 3D application events in and out (could be separated to another class for simplicity) - Disposal *Away3DCameraHandler.as* - Look at tweens etc - Camera position tweens - disposal -- Example view classes used in the scene -- * Away3DVideoWall.as - Object for the 3D scene - Disposal Away3DSomeOtherObject1.as - Object for the 3D scene - Disposal Away3DSomeOtherObject2.as - Object for the 3D scene - Disposal etc (And if larger 3D application would have some folders in there seperating out the objects, events, etc) This will then minimise the damage of implementing Away3D scenes into the project and keep it clean, fast and easy to see where things are before even looking at the code. Will be a simple job to just send notifications to the framework when needed from the Away3D part of things. So now I need to cook up some test projects, create new Robotlegs and PureMVC templates for when I get this request again (this will probably change my above theoretical idea of how it will work - but should be close). Code and structure varies for us all, but never that much. D * On 24 March 2011 03:08, katopz <[email protected]> wrote: > Robotlegs suppose to be simple and ease to use, if it start to > complicate... I think you are doing wrong, and from my point of view > you don't need to put everything in mvc, especially when you need > speed in there (irony that put all code in 1 class is fastest fps) > > If it would be me I'll put 3d engine in view and doing mediator thing > in renderer loop, you can get some idea for this in jiglib example, > let say jiglib is mediator and away3d is view should get you some > picture :) > > hth > > On Thursday, 24 March 2011, Darcey Lloyd <[email protected]> wrote: > > I don't see any correct way of doing it either in these frameworks, I am > no framework architect guru and doubt I ever will be so I thought it was > just something I was missing. > > I guess I will stick to hacking it in and encapsulating it within a > folder to keep it all in one simple place for editing when I am forced to > use these frameworks. > > > > Cheers for all the info. > > D > > > > > > > > > > On 23 March 2011 23:39, John Lindquist <[email protected]> wrote: > > I honestly just don't think it's a good idea to have rendering/ > > collision/etc handled in an mvc framework and I'm afraid that if I > > made an example of how you "could" do it than people would think > > that's how you "should" do it :/ > > > > Besides, robotlegs is meant to mediate regular DisplayObjects, so > > you'd have to go against all those "guidelines" you're trying to > > follow just to even get it working. > > > > On Mar 23, 3:28 pm, Darcey Lloyd <[email protected]> wrote: > >> I never get a say in it... I just get phone calls like, > >> > >> "can you use robotlegs?", "yes" > >> "know papervision?", "yes" > >> > >> and when I get there, I convert them to the light which is Away3D but > when I > >> suggest not implementing Robotlegs or PureMVC for some of the tiny > projects > >> they have me work on, the parrot learned extensibility lecture begins, > so > >> now I don't bother trying. > >> > >> D > >> > >> On 23 March 2011 19:23, rhys thomas <[email protected]> wrote: > >> > >> > >> > >> > >> > >> > >> > >> > Cool cool, I would recomend it though as bojinx works the same as > robot > >> > legs but much better at the same time and no need for half the stuff > that > >> > robot legs forces you to use, I understand what your saying though as > >> > perhaps the client has requested robot legs but its worth suggesting > bojinx > >> > to them as its soooooo much better :) > >> > On 23 Mar 2011 19:18, "Darcey Lloyd" <[email protected]> wrote: > >> > > *@Rhys:* > >> > >> > > I have to use Robotlegs or PureMVC - they are nearly always the job > >> > > requirements. > >> > >> > > *@John* > >> > > Nice video, very clean, very efficient... > >> > > You have converted me to IntelliJ (installed and using) very nice, > now I > >> > > just need a list of shortcuts ;) > >> > >> > > The issue I have is where in RobotLegs would I place the logic for > >> > > processing logic to render (enter frame), camera tweening and logic > to > >> > > handle a collision multiple objects (if 3D objects are considered as > >> > > separate views). > >> > > After watching the video I get this far: > >> > >> > > *Away3DContext.as *(mapViews to mediators and instantiate view > >> > components) > >> > > *Away3DEvent.as* (event constants) > >> > >> > > *Away3DViewComponent.as* (setup) > >> > > *Away3DMediator.as* > >> > >> > > - Handle enter frame render > >> > > - Handle render enable / disable notifications > >> > > - Handle camera setup > >> > > - Handle camera tweening notifications > >> > >> > > *Away3DCube1ViewComponent.as *(setup) > >> > > *Away3DCubeMediator.as* (onClick handlers for change to random > colour) > >> > >> > > *Away3DCube2ViewComponent.as* (setup) > >> > > *Away3DCube2Mediator.as *(onClick handlers for change to random > colour) > >> > >> > > but where would the logic go for handling the two view components > (cube 1 > >> > > and cube 2) if I was to animate them bouncing around: > >> > > where would be the correct place to process logic for a collision > and > >> > > change of animation direction. > >> > >> > > From here I am not sure: > >> > >> > > 1. Where would the correct place be for the logic to handle the > animation > >> > >> > > of cube 1 and cube 2 view components (in the > Away3DViewComponent.as)? > >> > > 2. Where would the correct place be for the logic to handle > collision > >> > >> > > detection (in the Away3DViewComponent.as)? > >> > >> > > If I am correct (not 100%), a view component should not be aware of > other > >> > > view components and should only handle logic for themselves. > >> > >> > > I understand the event system (I hope lol), just when it comes to > >> > > implementing Away3D or enter frame handlers on views / compone > > -- > Regards > ----------------------------------------------------------- > Todsaporn Banjerdkit, katopz, http://sleepydesign.com > Away3DLite and JigLibFlash Developer Team >
