3d

QML load and display .ply mesh with color attributes

萝らか妹 提交于 2020-08-10 05:00:07
问题 I am trying to load a simple cube with per-vertex color information from a Stanford PLY file using QML. My entity looks like this: Entity { id: circle property Material materialPoint: Material { effect: Effect { techniques: Technique { renderPasses: RenderPass { shaderProgram: ShaderProgram { vertexShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.vert") fragmentShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.frag") } } } } parameters:

Extruding a line in three.js

筅森魡賤 提交于 2020-08-07 04:04:38
问题 I have a line (of points) and I want to extrude it. What would be a simple way to achieve this? 回答1: I've found a solution. Not sure if this is the best way because three.js throws an info to use PlaneBufferGeometry instead. function extrudePath( points, depth ) { var geometry = new THREE.PlaneGeometry(0, 0, points.length - 1, 1); var vertices = geometry.vertices; for (var i = 0, l = points.length, p; i < l; i++) { p = points[i]; vertices[i].x = vertices[i + l].x = p[0]; vertices[i].y =

r plotly how to get 3d surface with lat, long and z

荒凉一梦 提交于 2020-07-29 07:26:25
问题 I have latitude, longitude and data value for about 10 locations. Here's an example of a data frame I can easily construct for my problem x <- c("-108.6125","-108.5114","-108.805","-108.4014","-108.5615","-108.8349","-108.225","-108.3139","-108.5568","-108.4968") y <- c("39.02205","39.22255","39.598","38.89478","39.06429","39.27625","39.03","39.1306","39.14823","38.89795") z <- c("60.7735","56.45783","49.65","60.15","50","53.95417","50.825","56","55.843","38.73333") df <- data.frame(x = as

How to get the intersection point? Ray Triangle Intersection C++

痞子三分冷 提交于 2020-07-24 02:06:58
问题 I would like to get the intersection point on a triangle when a ray go through it. I followed the on line tutorial and made a function, but I could not get the correct coordinates of intersection point. For example, I should get the intersection point (0, 3, -1), if I use ray origin (0, 2, -1), ray direction (0, 1, 0), triangle vertices p0 (0, 3, 0), p1 (-0.5, 3, -1), p2 (0.5, 3, -1). However, I have got the intersection point (0, 7, -1), which was not correct. I appreciate your time and help

How to get the intersection point? Ray Triangle Intersection C++

旧时模样 提交于 2020-07-24 02:02:47
问题 I would like to get the intersection point on a triangle when a ray go through it. I followed the on line tutorial and made a function, but I could not get the correct coordinates of intersection point. For example, I should get the intersection point (0, 3, -1), if I use ray origin (0, 2, -1), ray direction (0, 1, 0), triangle vertices p0 (0, 3, 0), p1 (-0.5, 3, -1), p2 (0.5, 3, -1). However, I have got the intersection point (0, 7, -1), which was not correct. I appreciate your time and help

How to get the intersection point? Ray Triangle Intersection C++

最后都变了- 提交于 2020-07-24 02:01:45
问题 I would like to get the intersection point on a triangle when a ray go through it. I followed the on line tutorial and made a function, but I could not get the correct coordinates of intersection point. For example, I should get the intersection point (0, 3, -1), if I use ray origin (0, 2, -1), ray direction (0, 1, 0), triangle vertices p0 (0, 3, 0), p1 (-0.5, 3, -1), p2 (0.5, 3, -1). However, I have got the intersection point (0, 7, -1), which was not correct. I appreciate your time and help

C++ 3D array declaration using vector

拈花ヽ惹草 提交于 2020-07-23 02:04:07
问题 I have some C++ code where I am declaring 2D arrays using "vector" with the following method: std::vector<std::vector<double>> Array2D(X, std::vector<double>Y); where X and Y are the dimensions of the array. This works beautifully for what I need to achieve. However I would like to look at using the same method for 3D, XYZ arrays. I assume I start with: std::vector<std::vector<std::vector<double>>> but how do I declare the dimensions, ie Array3D(X, ?????) 回答1: There is fill vector constructor

C++ 3D array declaration using vector

拈花ヽ惹草 提交于 2020-07-23 02:02:48
问题 I have some C++ code where I am declaring 2D arrays using "vector" with the following method: std::vector<std::vector<double>> Array2D(X, std::vector<double>Y); where X and Y are the dimensions of the array. This works beautifully for what I need to achieve. However I would like to look at using the same method for 3D, XYZ arrays. I assume I start with: std::vector<std::vector<std::vector<double>>> but how do I declare the dimensions, ie Array3D(X, ?????) 回答1: There is fill vector constructor

Projecting the ARKit face tracking 3D mesh to 2D image coordinates

时光怂恿深爱的人放手 提交于 2020-07-15 08:42:26
问题 I am collecting face mesh 3D vertices using ARKit. I have read: Mapping image onto 3D face mesh and Tracking and Visualizing Faces. I have the following struct: struct CaptureData { var vertices: [SIMD3<Float>] var verticesformatted: String { let verticesDescribed = vertices.map({ "\($0.x):\($0.y):\($0.z)" }).joined(separator: "~") return "<\(verticesDescribed)>" } } I have a Strat button to capture vertices: @IBAction private func startPressed() { captureData = [] // Clear data

Projecting the ARKit face tracking 3D mesh to 2D image coordinates

我与影子孤独终老i 提交于 2020-07-15 08:42:26
问题 I am collecting face mesh 3D vertices using ARKit. I have read: Mapping image onto 3D face mesh and Tracking and Visualizing Faces. I have the following struct: struct CaptureData { var vertices: [SIMD3<Float>] var verticesformatted: String { let verticesDescribed = vertices.map({ "\($0.x):\($0.y):\($0.z)" }).joined(separator: "~") return "<\(verticesDescribed)>" } } I have a Strat button to capture vertices: @IBAction private func startPressed() { captureData = [] // Clear data