3d

Volumetric 3D data plotting from 2D map in MATLAB?

旧巷老猫 提交于 2021-01-29 07:19:06
问题 I have a heat map and want to convert this 2D matrix to a 3D volume/shape/surface data points for further processing. Not simply display it in 3D using surf . What would be a good way to do this? With a lot of help from this community I could come closer: I shrunk the size to 45x45 px for simplicity. I = (imread("TESTGREYPLASTIC.bmp"))./2+125; Iinv = 255-(imread("TESTGREYPLASTIC.bmp"))./2-80;% for i = 1:45 for j = 1:45 A(i, j, I(i,j) ) = 1; A(i, j, Iinv(i,j) ) = 1; end end volshow(A) Its not

Subtracting Geometry in Three.js (or really, 3D programming in general)

吃可爱长大的小学妹 提交于 2021-01-29 06:50:22
问题 I'm currently working on a small project with which I need to subtract a rectangular area of a cube on mousemove (think, an indented area for placing a door on a house). The 'door' would be 'placed' on click, but would need to be 'visualized' while the user is deciding its location; in reality, nothing changes except the fact that the user is no longer moving it around. The issue here is finding an efficient way of allowing a user to move the door around, while it interacts and modifies the

R: Adjust Color Gradient for 3DBarplot using latticeExtra cloud in R

久未见 提交于 2021-01-29 05:33:40
问题 I am trying to change the colors of the 3d bar plot so that the colors go from green, to yellow, to orange, to light red, to red, to dark red. However, whenever I plot it, it looks like the colors start repeating after green. Is there something, I can do to fix this? The output that I get is: The output that I want is this: enter image description here This is the code, I am using. It gives me the first picture. That is not what want. I want the colors to look the way they look in the second

Superimposing vectors, dgrid3d and pm3d in gnuplot for 3D plot

ε祈祈猫儿з 提交于 2021-01-29 02:57:49
问题 I am trying to plot a vector field in Gnuplot superimposing dgrid3d, pm3d and vectors. I can get dgrid3d and pm3d to work but when I try to superimpose the vectors weird things happen. I am trying the following: set dgrid3d 50,50,2 set pm3d at b set hidden3d splot 'v-field.dat' u 1:2:6 w l, "" u 1:2:3:4:5:6 w vectors Data is in the format: 0.0000000020000000 0.0833272880000000 0 0 0 1.62609277247135e-09 0.5000000020000001 0.5833272880000000 0 0 0 0.965930741599645 0.8749688835000000 0

Issue with “blocky” model in x3dom

梦想的初衷 提交于 2021-01-29 02:01:59
问题 I am trying to use a 3d Studio Max model with x3dom. I did not create the model nor do I know much about 3d rendering/animation. The image on the left shows the rending of the model from 3d Studio Max. The image on the right shows the same model inside of x3dom. link to image I started off with a .3ds, a .max, and a .wrl file. I converted all three of these to .x3d. Each one gave the same results. I am new to x3dom, but it seems pretty straightforward as far as displaying pre-made models. Is

Issue with “blocky” model in x3dom

一世执手 提交于 2021-01-29 01:59:12
问题 I am trying to use a 3d Studio Max model with x3dom. I did not create the model nor do I know much about 3d rendering/animation. The image on the left shows the rending of the model from 3d Studio Max. The image on the right shows the same model inside of x3dom. link to image I started off with a .3ds, a .max, and a .wrl file. I converted all three of these to .x3d. Each one gave the same results. I am new to x3dom, but it seems pretty straightforward as far as displaying pre-made models. Is

How to plot data on a cylindrical grid using slice?

此生再无相见时 提交于 2021-01-28 20:46:24
问题 I have input data on a cylindrical grid and want to plot them using slice in MATLAB. To do this I first transform the reference coordinates into Cartesian coordinates using pol2cart . r = linspace(1,4,4); phi = linspace(0,2*pi,10); z = linspace(1,3,3); [rmesh,phimesh,zmesh]=meshgrid(r,phi,z) [xmesh,ymesh,zmesh]=pol2cart(phimesh,rmesh,zmesh) When I use slice now (e.g. slice(xmesh,ymesh,zmesh,ones(10,4,3),2,2,2) ) an error is thrown, because the coordinate matrices are not ordered correctly (

Assigning a 2D image for every face of a 3D cube: MATLAB

泄露秘密 提交于 2021-01-28 20:41:36
问题 I want to build a cube in MATLAB and assign different 2D images for its faces. I think this is called texture mapping. I've searched for such a code, but what I found is a code that is able to assign a single image to all of the cube faces, the code is available here (http://www.mathworks.com/matlabcentral/answers/32070-rgb-images-on-a-3d-cube). Here is the code, cdata = flipdim( imread('peppers.png'), 1 ); cdatar = flipdim( cdata, 2 ); % bottom surface([-1 1; -1 1], [-1 -1; 1 1], [-1 -1; -1

Assigning a 2D image for every face of a 3D cube: MATLAB

為{幸葍}努か 提交于 2021-01-28 19:25:19
问题 I want to build a cube in MATLAB and assign different 2D images for its faces. I think this is called texture mapping. I've searched for such a code, but what I found is a code that is able to assign a single image to all of the cube faces, the code is available here (http://www.mathworks.com/matlabcentral/answers/32070-rgb-images-on-a-3d-cube). Here is the code, cdata = flipdim( imread('peppers.png'), 1 ); cdatar = flipdim( cdata, 2 ); % bottom surface([-1 1; -1 1], [-1 -1; 1 1], [-1 -1; -1

SceneKit - Remove stitching line in edges borders

帅比萌擦擦* 提交于 2021-01-28 18:22:11
问题 I'm displaying a texture on a cube (see SceneKit - Map cube texture to box) Things work well now, but the result show a light stitching line between some of the cube faces that I outlined here (you are inside the cube): Any idea how I can get rid of that? The input texture looks like So there is some discontinuity in the input. I'm using a custom SceneKit geometry that doesn't do much more than mapping this texture to a cube. You can find the relevant code in question mentioned above: https:/