3d

Smooth 3D trangular mesh in R

心已入冬 提交于 2020-01-05 16:29:51
问题 I am drawing a 3D surface mesh of human face. Data can be found at https://github.com/Patricklv/Smoothing-3D-surface, where vb.xlsx contains vertices and it.xlsx contains faces. My R code is as follows: library(xlsx) library(rgl) vb <- read.xlsx("C:\\Users\\<Username>\\Desktop\\vb.xlsx", sheetIndex = 1, header = F) it <- read.xlsx("C:\\Users\\<Username>\\Desktop\\it.xlsx", sheetIndex = 1, header = F) vb_mat <- t(as.matrix(vb)) vb_mat <- rbind(vb_mat, 1) rownames(vb_mat) <- c("xpts", "ypts",

Smooth 3D trangular mesh in R

大憨熊 提交于 2020-01-05 16:29:27
问题 I am drawing a 3D surface mesh of human face. Data can be found at https://github.com/Patricklv/Smoothing-3D-surface, where vb.xlsx contains vertices and it.xlsx contains faces. My R code is as follows: library(xlsx) library(rgl) vb <- read.xlsx("C:\\Users\\<Username>\\Desktop\\vb.xlsx", sheetIndex = 1, header = F) it <- read.xlsx("C:\\Users\\<Username>\\Desktop\\it.xlsx", sheetIndex = 1, header = F) vb_mat <- t(as.matrix(vb)) vb_mat <- rbind(vb_mat, 1) rownames(vb_mat) <- c("xpts", "ypts",

3D libgdx rotation

瘦欲@ 提交于 2020-01-05 09:34:58
问题 I think this question is not a duplicate, or if it is, I couldn't understand how to make this work. (sorry for my great drawing capabilities...) I have a ball, radius 0.5 (so, perimeter is 3.1415926). In each frame, I have it in oldPosition and I want to place it in position , so, move in the blue arrow direction, represented by the v vector in the drawing. This is easy. The trick is that I want the ball to be rotated in the target position. The rotation axis should be perpendicular to the

Threejs: Rotate sphere(globe) to another point(city) on the sphere itself

时光毁灭记忆、已成空白 提交于 2020-01-05 08:52:06
问题 I'm building a globe(sphere geometry) with set of predefined locations on geo-mapped and drawn as point(sphere geometry). I would like to focus(moving one location to another) those locations by rotating globe along y-axis. I tried the following code, seems not working for all locations. location.geometry.computeBoundingBox(); var position = new THREE.Vector3(); position.subVectors( location.geometry.boundingBox.max, location.geometry.boundingBox.min ); position.multiplyScalar( 0.20 );

3D Ellipsoid out of discrete units

大城市里の小女人 提交于 2020-01-05 08:06:22
问题 I'm trying to draw an ellipsoid in 3d space out of individual blocks. I have no problem with 2D ellipses, but as far as 3D goes I'm having some trouble. I'm using Bresenham's circle algorithm to draw 2D ellipses. What I'm trying to do is draw 2D ellipses in layers with an increasing (starting from the bottom going up, using symmetry for the other half) radius on both the X radius and Y radius. It all sounds like it would work, but when I go to implement it, I can't figure out how to alter the

3D Ellipsoid out of discrete units

江枫思渺然 提交于 2020-01-05 08:06:19
问题 I'm trying to draw an ellipsoid in 3d space out of individual blocks. I have no problem with 2D ellipses, but as far as 3D goes I'm having some trouble. I'm using Bresenham's circle algorithm to draw 2D ellipses. What I'm trying to do is draw 2D ellipses in layers with an increasing (starting from the bottom going up, using symmetry for the other half) radius on both the X radius and Y radius. It all sounds like it would work, but when I go to implement it, I can't figure out how to alter the

Fill area between two segments in a 3D plot {rgl}

做~自己de王妃 提交于 2020-01-05 08:01:26
问题 I have made a tetrahedron using vertex coordinates and line segments using the function plot3d() from the package {rgl}. The code below makes the mentioned plot library("rgl") CCl4=c(5,5,5,10) Luminol=c(0.01,0.001,0.005,0.005) Na2CO3=c(0.01,0.01,0.1,0.05) plot3d( Luminol, Na2CO3, CCl4, type = "s") for(i in 1:4){ for(k in 1:4){ segments3d(x=Luminol[c(i,k)],y=Na2CO3[c(i,k)],z=CCl4[c(i,k)]) } } Now, I want to fill the area between the points (preferably using a RGB color so I can define

Point look at Point

烂漫一生 提交于 2020-01-05 06:59:07
问题 So I have one point in 3D space, and I have location and rotation of the Camera in 3D space. So basically there is Vector3 on the object. Camera Vector3 and Quaternion . I need to get how to look at that point. I want to tell user how to move to that point. Should user direct camera left or right or behind? 回答1: One way to do this is to calculate the direction the camera is currently facing as a yaw angle (like a compass heading), and calculate the direction it needs to face in order to be

THREE.js - Graphical Glitch with an imported model

六月ゝ 毕业季﹏ 提交于 2020-01-05 06:43:11
问题 I'm experiencing a graphical glitch with an imported model while using JSONLoader. I can't really explain it, you'll have to see it. It may have something to do with the different materials and the camera POV. You can find the plunk here: http://plnkr.co/edit/0VjHiGNmWFHxdoMWC3GV?p=info JSONLoader part of the code: var loader = new THREE.JSONLoader(); loader.load( 'tv.js', function ( geometry, materials ) { var tv = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial(materials) ); glScene