Mark a selected Geometry highlighted

Hello,



I have now implemented Drag’n’Drop support for my nodes. Before I drag a node, I want to select it. If the node (geometry) is selected, I want it to be highlighted in any way. I was thinking about a “red border” which is only drawn around the outer limits. I assume that I need shaders for this. something like cartoon shader, but, of course, it must only have an effect on a single geometry not on all. How does this work?



Thanks.



Regards,

Equi

oh my god.



This will become problematic if you have to load models which are constructed out of different scene nodes posessing own geometries, to make single parts of the model indepandantly movable. I am thinking of the hover tank example. You could build a main body of the hover tank and you could design its weapon as own geometry. In blender for example it is no problem to make child-parent relationships and everything is exported correctly to collada 1.4. I am loading the hover tank in this way.



So, if I click on the weapon which is a child wrapped within a scene node, I have to parse down the tree clone it set its world location and rotation. It is more problematic if the hover tank moves and/or its weapon moves or rotates independanty. You have to make a 1:1 relation between the objects in the normal scene graph and the cloned object in the selectionScene graph.



This will be hard. :slight_smile:



JME rules

In jMP I simply create a new viewport and attach a copy of the mesh with a new/different materrial to that.

Hello,



can I use the same camera? I think yes.



Thanks.



Regards,

Equi

How would you want to use another?

Hello,



ok. now I understand why the camera instance has to be added to the viewPort constructor and why the viewPort is not added via an addViewPort method to the camera. However, I also have to attach a scene to the viewPort. If I understand you correctly, If I have got 151 geometries in my scene, and only one should be highlighted, I only add one and only one clone instance of the mesh with a new mateial to a new sceneGraph, let’s call it selectionSceneGraph. If my mene scenegraph contains node hierarchies of scene nodes, let’s say



sceneNodeA–>sceneNodeB–>sceneNodeC–>myGeometry, it would be necessary either to copy this scenegraph to the selectionSceneGraph or directly use setWorldLocation and setWorldRotation to my selected cloned mesh.



Thanks.



Regards,

Equi

Yes

In a modern real tank (done maintenance on the Leopard2, real fun), the cannon doesn’t rotate relly independently. It has a computer on board that rotates it and keeps it on the target if while the tank moves around. You’ll have to do the same.



You want to use your dragging to pick and place parts? Why not just add a light to the single selected Geometry while selected?

I’m not exactly sure how to do it in Jmonkey but you could write a shader that highlights a certain object. So you pick the object with the mouse, pass that object to the shader.

You’d have to change all shaders etc. for that. If you dont want to move around the shapes ane dont mind modification of your scenegraph, you can attach the new shapes to nodes that replace the specific geometry, similar to PhysicsNodes with debug shapes.

Why not just create a selectionMaterial and just change the material of the selected object?

I think it would be a lot easier

In some way that’s exactly what i’m trying to do , if you found a solution please post it

nehon said:
Why not just create a selectionMaterial and just change the material of the selected object?
I think it would be a lot easier

Not everything's a geometry.

mhh right!