I am using the Graphstream library to create a visual representation of a Tree structure.
Current view of graph
But the nodes are all clumped together. What can I do to make the graph look like -> Image for Manually arranged nodes.
Is there a way to store node positions from graph to a file and then load them when the application is running?
Related
I'm developing an application and I have a map like the following and I want to extract the nodes and edges connecting these nodes in order to be able to apply any shortest path algorithm and have the data as a graph.
I used canny edge detector and it worked however it only displays the image after modification but doesn't save the data and I wanted it as vectors
What can I use to do do the following ???
Thanks in advanceenter image description here
I already created graph with different color each graph based on some attribute in its node. This is my current graph
Is it possible to place node that has same color closely? How could I implement that?
I am looking for a similar functionality and came across Viewers (http://graphstream-project.org/doc/Tutorials/Graph-Visualisation_1.0/). I disabled the default viewer and mentioned co-ordinates for individual nodes (which works but doesn't look pretty and is additional headache to mention co-ordinates in the code).
However, I haven't figured out if we can still use default viewer and group nodes based on some attributes.
Let me know if you figure out a way to do that.
I am trying to get a better understanding of the Models and their Nodehierarchy in Libgdx.
As much as i understood, a Model is made of many ChildNodes, which can contain other Nodes as well. Each node has a Vector3 translation describing its position, Vector3 scale, describing its scale and Quaternion rotation describing its rotation, all relative to the parent Node or Model. The Matrix4 gloabalTransform describes the same, but relative to the world they are in.
Now if i think about games like Garrys Mod, where the Models of the Players can move parts of the model dynamically (for example if they lie on an edge after they died their upper body can hang down the wall), i can only think about, that they modify the single Nodes at runtime, in their source code.
Now my questions:
Is my assumption correct?
Do i have the possibility to create the Nodes in Blender (lets say 1 Node is the left lower leg, 1 Node is the left upper leg...) and get and change them at runtime by using (for example) modelInstance.getNode("leftLowerLeg").translation.set(Vector3 position), or are they created and named automatically, depending on the shape, facecount...?
Thanks a lot!
Looking at that it appears that the concept of node is that of scene graph. Your model can be made of parts (MeshPart) and each separate part is a child of a node. Having a separate node means you can apply transforms to it thus moving it independently from any other model part. So it appears that you do want to construct your model as separate parts and load those parts in a hierarchy of nodes to suit your needs. Keep a reference to the node you want to move independently and apply transforms.
Node can "contain" a MeshPart (i.e. MeshPart is child of Node) Nodes can contain other nodes. take a look wikipedia for scene graph terminology. Hang on the docs for Model say "A model represents a 3D assets. It stores a hierarchy of nodes. A node has a transform and optionally a graphical part in form of a MeshPart and Material. Mesh parts reference subsets of vertices in one of the meshes of the model. Animations can be applied to nodes, to modify their transform (translation, rotation, scale) over time." Note it says sub set of vertices which implies that the model is one model but you separate them for your needs assigning different sub sets into Nodes.
From Xoppa:
This tutorial shows how to use the node hierarchy from the modeling application.
Here are two tutorials explaining the node structure and how to use it:
Theory
Practical
I am currently working on this exact problem. Nodes can have nodes which can have nodes! You can find a specific node using ModelInstance.getNode(String NameOfNode); which returns an object of type Node. These nodes are named what you named the objects in blender. EG, to get the Right shoulder bone in a model with the bone named Shoulder_R, you could do:
Node node = myModelInstance.getNode("Shoulder_R");
node that contains all the information pertaining to that bone, including translation, rotation, scale, and the appropriate transform matrices. I am currently stuck at the point of trying to manipulate these bones while an animation is playing, post the animation controller update.
My desired end result is to manually modify for example where an arm is pointing so its pointing at another object while the animation and model continue to play/move. I hope this helps you in your quest, and if you discover the answer to the remaining part of the mystery, please post back!
I want to virtualize my network simulations and need to plot the nodes in the network. Each node has a pre-defined location and I need to plot the nodes into the correct coordination.
I am using JUNG: http://jung.sourceforge.net/applet/index.html
Any suggestions?
Thanks!
I recently solved this problem by writing my own rendering Layout for JUNG.
As base for my derived layout I used the Circle Layout, which is pretty simple. In there you will see that JUNG does a setLocation(Dimension d) for every Vertex, which is pretty much what you are looking for, I guess. Just take a look at the source of the CircleLayout.
Then you could use a custom Vertex object, which stores the coordinates you want the vertex to have, which is then read by your custom layout.
I'm new to JUNG. I tried to draw a graph of a tree using the TreeLayout but the tree never comes out like a real tree. Every time the tree looks different. How can I make the tree look like a normal tree with the root on top & the rest of the nodes descending from it?
You have to Initialize the TreeLayout after adding the Vertexes to the graph, I tried that and it worked for me.
You have to do something like the following: (please note that this is a 1 year old code that i had, you might find it to be a little out dated)
Layout<GraphVertex, GraphEdge> layout; //create a layout
layout = new TreeLayout<GraphVertex, GraphEdge>((Forest<GraphVertex, GraphEdge>) g);
// initialize your layout using the graph you created, which has to be of type forest
vv.setGraphLayout(layout);
// set the layout of the visualization viewer you are using to be the layout you just created (the tree layout)
GraphVertex Is the class which represents a vertex in the graph, GraphEdge represents the edges in your graph.