volume-rendering

GPU ray casting (single pass) with 3d textures in spherical coordinates

好久不见. 提交于 2019-12-01 11:33:11
i' am implementing an algorithm of volume rendering "GPU ray casting single pass". For this, i used a float array of intensity values as 3d textures ( this 3d textures describes a regular 3d grid in spherical coordinates ). Here there are example of array values: 75.839354473071637, 64.083049468866022, 65.253933716444365, 79.992431196592577, 84.411485976957096, 0.0000000000000000, 82.020319431382831, 76.808403454586994, 79.974774618246158, 0.0000000000000000, 91.127273013466336, 84.009956557448433, 90.221356094672814, 87.567422484025627, 71.940263118478072, 0.0000000000000000, 0

C- Indexing x,y,z coordinates in a 1D byte array

谁说我不能喝 提交于 2019-12-01 06:51:52
问题 I want to evaluate the values of the surface to implement a marching tetrahedron algorithm, but I don't understand how to work with .raw unformatted data. After loading a .raw file with a volume dataset into a 1D byte array, what arithmetic transformation should be applied to get the value associated to X,Y,Z from it? This is the only way I know to load .raw files, could I create a 3D byte array instead of this? How? int XDIM=256, YDIM=256, ZDIM=256; const int size = XDIM*YDIM*ZDIM; bool

How can I get view direction from the OpenGL ModelView Matrix?

倾然丶 夕夏残阳落幕 提交于 2019-11-29 11:44:34
I am writing a volume render program that constantly adjusts some plane geometry so it always faces the camera. The plane geometry rotates whenever the camera rotates in order to appear as if it doesn't move--relative to everything else in the scene. (I use the camera's viewing direction as a normal vector to these plane geometries.) Currently I am manually storing a custom rotation vector ('rotations') and applying its affects as follows in the render function: gl2.glRotated(rotations.y, 1.0, 0.0, 0.0); gl2.glRotated(rotations.x, 0.0, 1.0, 0.0); Then later on I get the viewing direction by

Fast interpolation of regularly sampled 3D data with different intervals in x,y, and z

亡梦爱人 提交于 2019-11-28 23:16:15
I have some volumetric imaging data consisting of values sampled on a regular grid in x,y,z, but with a non-cubic voxel shape (the space between adjacent points in z is greater than in x,y). I would eventually like to be able to interpolate the values on some arbitrary 2D plane that passes through the volume, like this: I'm aware of scipy.ndimage.map_coordinates , but in my case using it is less straightforward because it implicitly assumes that the spacing of the elements in the input array are equal across dimensions. I could first resample my input array according to the smallest voxel

How can I get view direction from the OpenGL ModelView Matrix?

笑着哭i 提交于 2019-11-28 05:15:51
问题 I am writing a volume render program that constantly adjusts some plane geometry so it always faces the camera. The plane geometry rotates whenever the camera rotates in order to appear as if it doesn't move--relative to everything else in the scene. (I use the camera's viewing direction as a normal vector to these plane geometries.) Currently I am manually storing a custom rotation vector ('rotations') and applying its affects as follows in the render function: gl2.glRotated(rotations.y, 1.0

volume rendering (using glsl) with ray casting algorithm

无人久伴 提交于 2019-11-28 04:34:38
I am learning volume rendering using ray casting algorithm. I have found a good demo and tuturial in here . but the problem is that I have a ATI graphic card instead of nVidia which make me can't using the cg shader in the demo, so I want to change the cg shader to glsl shader. I have gone through the red book (7 edition) of OpenGL, but not familiar with glsl and cg. does anyone can help me change the cg shader in the demo to glsl? or is there any materials to the simplest demo of volume rendering using ray casting (of course in glsl). here is the cg shader of the demo. and it can work on my

volume rendering (using glsl) with ray casting algorithm

对着背影说爱祢 提交于 2019-11-27 00:30:44
问题 I am learning volume rendering using ray casting algorithm. I have found a good demo and tuturial in here. but the problem is that I have a ATI graphic card instead of nVidia which make me can't using the cg shader in the demo, so I want to change the cg shader to glsl shader. I have gone through the red book (7 edition) of OpenGL, but not familiar with glsl and cg. does anyone can help me change the cg shader in the demo to glsl? or is there any materials to the simplest demo of volume