Exporting displacement map - blender

can anyone help me with how to export the heightmap from blender, I export the Normal, Spec, and Color by just adding image texture and plugging it into BSDF shader, and export the model in obj. But the displacement texture do not export as other texture!

Related

Polyline drawn is showing below buildings

The polyline is drawn showing below building.
(source: gifyu.com)
How can I get the polyline top of all layers
please suggest
adding polyline as
var coordinates = locationsArrToAdd.map({ (location: CLLocation!) -> CLLocationCoordinate2D in
return location.coordinate
})
let polyline = MKPolyline(coordinates: &coordinates, count: locationsArrToAdd.count)
self.mapView.addOverlays([polyline], level: .aboveLabels)
According to Apple, the highest available level you can add an overlay to is the MKOverlayLevel.aboveOverlays constant you are currently using. However, their documentation states that this will:
Place the overlay above map labels, shields, or point-of-interest icons but below annotations and 3D projections of buildings.
From what I can see, the best solution is to disabled buildings in 3D mode, so that your polylines are visible:
self.mapView.showsBuildings = false

Javafx rotating a group with PersepectiveCamera as child rotates camera about its own axes, and not the group node's

Here is my code for my Group which has 3d rotates on it:
import javafx.scene.Group;
import javafx.scene.transform.Rotate;
public class Camera3D extends Group {
ControllableCamera camera;
Rotate rx = new Rotate(0, Rotate.X_AXIS);
Rotate ry = new Rotate(0, Rotate.Y_AXIS);
Rotate rz = new Rotate(0, Rotate.Z_AXIS);
public Camera3D() {
camera = new ControllableCamera(rx, ry, rz);
getChildren().add(camera);
}
}
I have three sliders adjusting the angle property of rx, ry, and rz. However, they are rotating it using the camera's axes (i.e. rz is always about the axis going through the screen)
I do not want this. I want these rotations to act on the Camera3D instance instead. Maybe I am just misunderstanding how this part of javafx works, but any help would be appreciated!

Qt5 QtChart drop vertical lines while using QScatterSeries

When I am using QScatterSeries, I can very easily draw point at (x, y). However, instead of points I would like to draw short lines, like in the figure below. How can I get about doing so?
I tried using RectangleMarker, but it just draws a fat square. I would prefer a thin line about 2px wide and 20px in height.
Is there a way I can add custom marker shapes?
Here are the code and the settings I use to transform my points into lines :
//create scatter series to draw point
m_pSeries1 = new QtCharts::QScatterSeries();
m_pSeries1->setName("trig");
m_pSeries1->setMarkerSize(100.0);
//draw a thin rectangle (50 to 50)
QPainterPath linePath;
linePath.moveTo(50, 0);
linePath.lineTo(50, 100);
linePath.closeSubpath();
//adapt the size of the image with the size of your rectangle
QImage line1(100, 100, QImage::Format_ARGB32);
line1.fill(Qt::transparent);
QPainter painter1(&line1);
painter1.setRenderHint(QPainter::Antialiasing);
painter1.setPen(QColor(0, 0, 0));
painter1.setBrush(painter1.pen().color());
painter1.drawPath(linePath);
//attach your image of rectangle to your series
m_pSeries1->setBrush(line1);
m_pSeries1->setPen(QColor(Qt::transparent));
//then use the classic QtChart pipeline...
You can play the marker size, the dimension of the image and the drawing pattern in the painter to adapt the size and shape of the rectangle to obtain a line.
In the picture, it's the black line. As you can see you can repeat the process for other series.
Keep in mind that you cannot use the openGL acceleration:
m_pSeries0->setUseOpenGL(true);
My work is based on the QtCharts/QScatterSeries example : QScatterSeries example
Hope it will help you.
Florian

Integrate FBX SDK to DirectX

I am working with FBX SDK 2013.3 and project on DirectX .
I need some basic knowledge,
Think that i have a cube, exported from Maya with .fbx extension, it has animation but problem isn't that now.
Now i need Load this .fbx file to DirectX, so indices,vertex positions must be handle.
I looked FBX SDK Documentations, Samples ( mostly ViewScene sample ) and i obtain some information.
const char* lFilename = ".\..\..\..\DuzZemin.fbx";
/* Memory Management */
FbxManager* myManager = FbxManager::Create();
FbxIOSettings* ioSettings = FbxIOSettings::Create(myManager,IOSROOT);
myManager->SetIOSettings(ioSettings);
// Importer
FbxImporter* myImporter = FbxImporter::Create(myManager,"");
if( !myImporter->Initialize(lFilename,-1,ioSettings))
{
/* Error Handling */
}
/* Scene for Imported File */
FbxScene* myScene = FbxScene::Create(myManager,"My Scene");
myImporter->Import(myScene);
// Memory DeAllocation
myImporter->Destroy();
FbxNode* rootNode = myScene->GetRootNode();
FbxMesh* myMesh = FbxMesh::Create(myScene,"");
int indexCount = myMesh->GetControlPointsCount();
and when build this code snippet, i am not getting any error. But in runtime ,
indexCount return with 0 value.
Do you see any wrong or missed requirement ?
Thanks for interest.
Well you create a mesh, but you don't point it to a mesh in your scene. When i have loaded an .fbx file i create a mesh pointer and then go into my scene and grab the mesh. Consider this code.
FbxMesh* mesh;
FbxNode* node = myScene->GetRootNode()->GetChild(0);
//I want my mesh to be formed by triangles so i convert the mesh into triangles
FbxGeometryConverter lConverter(node->GetFbxManager());
lConverter.TriangulateInPlace(node);
mesh = node->GetMesh();
now you should be able to get a correct vertex count from your mesh, and be able to extract the vertices. NOTE: If your .fbx file consist of more than one mesh then you would need to iterate thru the scene untill you find the desired mesh.
Hope this helps
FbxMesh* mesh;
FbxNode* node = myScene->GetRootNode()->GetChild(0);
//I want my mesh to be formed by triangles so i convert the mesh into triangles
FbxGeometryConverter lConverter(node->GetFbxManager());
lConverter.TriangulateInPlace(node);
mesh = node->GetMesh();

Google Maps zoom gets overridden, when using a kml file

How do I specify zoom level for google maps in a kml file or why is it that my zoom level gets over ridden when I load this file. My question is actually how do I control zoom of a map for the following link:
http://code.google.com/apis/maps/documentation/javascript/examples/layer-kml-features.html
By default, the map is centered and zoomed to the bounding box of the contents of the kml layer.
You can change the default behaviour with preserveViewport property of google.maps.KmlLayerOptions object. If you set it to true the map isn't centered and zoomed.
In the example, use:
var nyLayer = new google.maps.KmlLayer(
'http://www.searcharoo.net/SearchKml/newyork.kml',
{
suppressInfoWindows: true,
map: map,
preserveViewport: true
});
If you want to center and zoom to the contents of the kml layer later, use:
var bounds = nyLayer.getDefaultViewport();
map.fitBounds(bounds);
EDIT:
If you want the map to be always centered (but not zoomed) when the kml layer is loaded, utilize defaultviewport_changed event of the google.maps.KmlLayer object. You have to set the map center to the center of the kml layer default viewport. The event is triggered when the contents of the kml layer are loaded and its default viewport is computed.
google.maps.event.addListener(nyLayer, 'defaultviewport_changed', function() {
var bounds = nyLayer.getDefaultViewport();
map.setCenter(bounds.getCenter());
});