Nutiteq set layer level or height - position

i have a map application. In my map, there is two layer which i use. First layer shows traffic lines, second layer shows my route. In this point when i draw route somewhere, my route lines remain below the traffic lines. So i want to set height or level my route layer. It have to allways top of traffic lines.
I try to set z point of my mappos but it couldn't. Is there another way to set height my layer?
MapPos mapPos = new MapPos(longitudeValue, latitudeValue, 1);

Drawing order is determined by adding order of Layers, so you should use different layers for traffic and route, and add traffic Layer before route Layer. Within single Layer the order of objects is not determined.
Z value is not in use in current version, this is meant for 3D cases, like display of pipelines below ground, or airways above ground. However, the public version does not render basic vector objects in 3D, only 3D models are supported.

Related

HUD post-processing in Godot

I have a project in Godot that renders billboarded quads on top of enemies. The quads(meshinstances) are children nodes of the enemy nodes. I want to render just the quads to a viewport for post-processing, but the quads need to have the same position on screen that the enemies have (like a target reticle).
How can I apply a shader effect to the billboards only and not to the rest of the scene?
The Camera has a cull_mask property that lets you filter which layers it will see. And VisualInstances (such as MeshInstances) have a layers property that lets you specify to which layers they belong (by default they all belong to the first layer).
You can configure the layers names in Project Settings -> General -> Layer Names -> 3d Render. Do not confuse them with 3d Physics.
Thus, you can give a different layer to those quad MeshInstance you want, and then setup a new Viewport with a new Camera as child (make sure it is current) with a cull_mask that will only render that layer. That way only those MeshInstance will be rendered on that Viewport.
You probably want to to keep the properties of the Camera in sync with the Camera on main Viewport (not only its global_transform, but also fov or any other property you might change). You can archive this by copying its properties on _process of a script attached to the Camera which is inside the new Viewport.

How do I voxelize and fill a 3D textured OBB?

I have a set of Minecraft blocks and for each of them I want a volume (of an arbitrary size) containing the voxelized Minecraft block.
A Minecraft block isn't just an AABB that fills the whole block. It generally is a set of children AABBs that can be translated/scaled/rotated (OBBs) and can have a different color/texture for every face. Here's an example:
I have already developed a class called ModelVoxelizer that takes in a 3D triangular model and gives out the voxelization of it and to do that uses the OpenGL graphics pipeline. The issue with it is that it sets on the volume just the contouring voxels of the model. Instead, I want the Minecraft block voxelization to be filled inside.
A slice of the volume I'd (hopefully) get with my current ModelVoxelizer by voxelizing the 3 OBB (not always I have AABB!) that compose the Minecraft block above.
A slice of the volume I want (basically the one above but filled). The voxels inside should have a color averaged from the faces of the texture.
The problem:
So my problem is a rasterization problem where I have the volume (the 3D grid) and a OBB (a part of a Minecraft block) and I have to check which voxels are inside the OBB. For those that are inside/colliding I have to interpolate the values of the faces of the OBB (texture/color), based on the distance of the voxel from said faces.
Is it an already known issue? Am I trying to re-invent the wheel?
I appreciate any kind of suggestion about this, thank you.

Clear all Layers with vkCmdBeginRenderPass (Vulkan, Layered rendering)

I have a framebuffer with one color attachment, which is a cube map with 6 layers. I try to use layered rendering with the geometry shader. Rendering of a simple triangle to all layers works. But I am not sure how to clear all layers with vkCmdBeginRenderPass.
vkCmdBeginRenderPass supports pClearValues and clearValueCount but I can not specify the number of layers. So only the first layer is cleared. Setting clearValueCount to 6 and giving 6 clear values also does not help.
I saw that vkCmdClearAttachments seems to allow to specify the layers.
Is vkCmdClearAttachments the only way, or did I miss something? Is there maybe a reason that vkCmdBeginRenderPass only clears the first layer although rendering seems to render to all layers?
clearValueCount refers to the number of attachments to clear (with regards to their clearOp), not the layers of a framebuffer.
The number of layers to be cleared at the start of a renderpass (if clearOp is set to clear) for a framebuffer is specified via the layerCount of it's imageView's subresource.

Openlayers: How to keep a layer zIndex as set

I am using OpenLayers 2.13.1.
I have a vector layer and some WMS layers in a map. WMS layers can be added and removed but the vector layer always remains in map.
The vector layer is interactive therefore I want to keep that always on top of the WMS layer. I keep the zIndex of the vector over 1000 and keep zIndex of all WMS layers bellow 1000.
The problem occurs when I remove a WMS layer from the map: the vector layer goes bellow. I have noticed that method map.resetLayersZIndex() is invoked when I remove a layer which sets the zIndex according to the order in the layers array of the map.
Is there a way to keep the zIndex same as I set?
You have to move your important layer to the end of the map's layers-array after each addition of a layer:
map = ...
vectorLayer = ...
map.events.register('addlayer', map, function() {
this.setLayerIndex(vectorLayer, this.layers.length);
});

GEF: How to draw diagram bottom up

I'm trying to draw a tree within a GEF editor. The problem is that I need to draw it bottom up. I have a primary layer for the node figures, and a connection layer for the connections.
The primary layer is a FreeformLayer, the root edit part a ScalableFreeformLayeredPane. The primary layer has a XYLayout.
Now I need to find the bottom edge of the editor (= viewport???) in order to be able to draw the bottom level of figures ("tokens") at that position (bottom y of primary layer - height of tokens = y of tokens). How can I get that?
I've tried to do it with BorderLayout so the tokens get painted at the bottom of the editor (BorderLayout.BOTTOM), and the nodes above it in BorderLayout.CENTER, but I've run into trouble with selections, and the layout is far from what I want to achieve.
So basically I want to have all nodes in one layer. I can set the position of the tokens, but the nodes above them must be calculated dynamically. How can I do this within XYLayout?
Many thanks in advance!
(Alternatively, positioning the tokens in the y-centered would be acceptable if it's easier to achieve)
You could look at Zest Layout Algorithms to have some inspiration:
http://www.eclipse.org/gef/zest/

Resources