Loading terrains in Ogre and creating navigation mesh with Recast/Detour - mesh

I'm new to using Ogre and especially Recast/Detour, and I need a little help.
I'm loading a terrain in Ogre and creating a navigation mesh over the top of it with Recast/Detour. I wanted to loaded more complex terrains because as of right now, I can only load .mesh files which as far as I know can't contain other objects, like buildings, etc. I have two ways that I can think of to do this:
1) Export the .obj files with Blender to .scene files. Then use a third party .scene loader, like DotScene, to load these into Ogre. Then I'd have to figure out how to get Recast to create the navigation mesh on top of a whole scene.
2) Or use Ogre's new terrain loading system, which I haven't read much up on yet.
So if you've worked on a project that uses Ogre and Recast/Detour, how did you accomplish the loading of your terrains and creation of your navigation meshes?
EDIT:
I found a third option that will allow me to keep my current solution but to also load complex terrains. I figured out a way to combine Ogre meshes into one giant mesh file using Blender. I can still load the terrain as a .scene but the navmesh creation procedure does not work with the entities loaded that way, whereas a giant mesh loaded can use the same functionality I already had.

I have no experience with Recast or Detour, hence cannot really comment on your question, but I can point you to OgreCrowd which is a project that works with Ogre::Terrain + Recast/Detour and is open-source. So it might provide some inspirations/ideas/pointers:
Ogre Forum Thread: OgreCrowd - a crowd component for Ogre using Recast/Detour
This corresponding video shows that it can handle Terrain plus additional objects on top of it, so it matches your scenario.

Related

cytoscape show traffic between nodes along an animated path

I need to show things moving between nodes along their connection paths similar to this project. I haven't been able to find any examples of it in cytoscape, but I have used cytoscape in the past and prefer to keep using it for this as well. I would appreciate recommendations on how to approach this problem.
You've got a few options...
The easiest is the Marquee visual style. It produces a "marching ants" illusion in the direction of directed edges. Simply to the Styles tab in the Control Panel and select the "Marquee" style. In the EDGE tab, you can choose from 3 different Marquee Line Types. You could imagine mapping these 3 line types to 3 categories (or bins) of traffic density, for example. Or you could use color, thickness and/or transparency in combination with a marquee style to represent traffic density. You can see an example here:
https://youtu.be/MF0zsxEPoPc?t=44
There's also an app for animation! This takes the approach of interpolating any visual style (including position and existence) between any set of key frames you provide. So, for example, you would have a start and finish frame and then CyAnimator would make a movie file for you:
http://apps.cytoscape.org/apps/cyanimator
And yet another completely different approach: with the scripting capabilities of Cytoscape, you can pretty much do whatever you want. The Unit tests for the RCy3 package, for example, ends up being an almost psychedelic display of data vis potential (and the unit tests aren't even at full coverage, shame). So you could direct your own animations in real time with a bit of scripting in R or Python. Here's the RCy3 unit test demo and links to the scripting libs:
https://www.youtube.com/watch?v=IXqbdlUnzUE&t=1s (caution: flashing graphics)
https://bioconductor.org/packages/release/bioc/html/RCy3.html
https://py2cytoscape.readthedocs.io/en/latest/
I'm using cytoscape.js with meteor.js. My elements, stylesheet and vehicles (shown as red dots) are stored in mongo, and can be updated via an external process or edited on-screen. The graph can be restructured or reshaped on the fly, and the vehicles will discover the new least-cost route to reach their target. Moves are queued with eles.animate() Routing is handled by eles.floydWarshall().path(). This might be similar to what you had in mind.

Javafx dynamically fxml load at Runtime

I have an application that cover a wide number of use cases each with completely independent workflows but workflows are pretty static after installation.
I have therefore created an HBox placeholder that will load the workflow for an installation.
Is there a way to dynamically load a section of the fxml from a database or a separate file archive? This fpml will have to have its own set of images and resources needed to achieve the workflows functionality.
TBH, I don't know where to start on this one.
Regards
I do not quite understand your problem. You can modify the scene graph at any time you want. So, of course it is possible to load a part of the scene graph from an FXML file at any time and hook it up to the already existing part. In your controller you have access to your HBox placeholder and when you have loaded the second part of the scene graph you can just add it via hbox.getChildren().add(newpart), were newpart is the root node of your second scene graph part. Of course you have to make sure that the layout works correctly for your constellation.
Your question seems nonsense because the FXML is always loaded dynamically. My guess is you are confused because most of the examples use FXML in the same bundle as the classes and so are loaded trough the getResource method. But the FXML loader takes any kind of InputStream, so you can just open a database blob or a file as an InputStream and give that InputStream as an argument to the loader. Be sure to catch the runtime exceptions though :)
Hope this helps.

Exporting animations from blender to use with Assimp

I noticed that if I export my blender project as a obj-file I have the option to toggle "Export Animation" which will make alot of files, one for each frame.
I wanted to use the Collada (.dae) format to export my animations. Problem is, when I load my Collada file it says that NumAnimations == 0!
1) Why does a file that is supposed to store animation say 0 animation?
2) When I do get it to work, how to I swap between frames in Assimp?
1) Animation import should work, your problem is probably the export. Have you tried reading through your collada file? Watch for <library_animations> and the like.
2) Assimp has no notion of frames. aiAnimation consists of multiple channels (aiNodeAnim) which define transformations (keyframes) for nodes at specific ticks/time. To compute all transformations one needs to interpolate the correct keyframes depending on the current playback time and mTicksPerSecond of aiAnimation.

Maya: Create temporary MFnMEsh for smooth export

Im writing an exporter that exports the subdivision preview mesh via the 'generateSmoothMesh()' method like this:
MFnMesh mesh(mesh_dag_path);
MFnMesh subdiv_mesh(mesh.generateSmoothMesh());
but after the export finishes the new subdivided geometry is left in my maya scene. How should i deal with this geometry, or is this even the right way to be doing this export?
my first instinct is to delete the geometry after the export is finished, if this is the correct thing to do does anybody know he correct way to delete the geometry from the api
Saying you need to do it from the API makes me think this is a command plugin. Correct me if I'm wrong. One way to do it is to run MEL code from your plugin with MGlobal .
MGlobal::executeCommand(MString("delete meshTransform;"));
Where meshTransform is the transform of the newly created mesh. You can get it by having parentOrOwner be MObject::kNullObj.
Or you can directly use:
MGlobal::deleteNode()

Sencha Touch 2 Memory Management Options

I'm looking into ways to save memory in Sencha Touch 2. I see two options, as I'll describe below.
I'd like to get advice on the difference of memory consumption between the two options, and to know if I'm missing anything.
Memory-saving options
Remove and Destroy
Remove unused components from their containers, and destory them. When they're needed again, re-create them.
Advantage:
this approach can be greatly assisted by container ref's 'autoCreate' option and by container config's 'autoDestroy' option.
Disadvantage:
to re-create the view as it was before destruction, you need to make sure every important piece of information you wish to recreate (e.g. scroll-location in list, map-center in map) is kept as state elsewhere.
Remove
Remove unused components from their containers WITHOUT destroying them. When they're needed again, re-attach them to their containers.
Advantages
no need to keep GUI-related information somewhere as state.
the component could be updated even when not appearing in the DOM.
Disadvantages
the component is cleared from the DOM, but the Sencha object is still kept in memory
you'd need to keep detached components somewhere, and make sure to check for - and attach - existing ones before creating new ones
I also posted this on the Sencha forums: http://www.sencha.com/forum/showthread.php?200314-Memory-Management-Options
I got the following, rather general answer:
If you remove the component but do not destroy it, you minimize DOM size but of course you still have that component in device memory. The benefit is since DOM size is down, you have better performance and DOM size is going to have a larger impact than having some components in memory.