3d

Rotation of a point about the z-axis

时光毁灭记忆、已成空白 提交于 2020-01-03 22:56:10
问题 I have 3 vectors in 3D space. Let's call them xaxis , yaxis , and zaxis . These vectors are centered about an arbitrary point somewhere in 3D space. I am interested in rotating the xaxis and yaxis vectors about the zaxis vector a number of degrees θ . For the following code with values being arbitrary and unimportant: double xaxis[3], yaxis[3], zaxis[3], point[3], theta; How would I go about rotating xaxis and yaxis about the zaxis by theta degrees? Future Note: These attempts do not work.

How do I draw the outline of an object in Qt3D?

落爺英雄遲暮 提交于 2020-01-03 19:15:29
问题 How can I draw the outline of an object on top of any other object in Qt3D? For instance to highlight a selected object in a 3D editor? 回答1: If you want to draw the outline of an entity at all times, even if the entity is behind other entities, one solution is to do it in two steps: Draw everything as normal. Draw only the outline of the selected object. When drawing the outline, you need to use an outline effect, which can be implemented in two render passes: Render the geometry to a texture

3D sparse matrix implementation?

北城以北 提交于 2020-01-03 17:08:29
问题 I've found a quite good sparse matrix implementation for c# over http://www.blackbeltcoder.com/Articles/algorithms/creating-a-sparse-matrix-in-net. But as i work in 3d coordinate-system, i need a sparse-matrix implementation that i can use to map the 3d-coordinate system. Details: I'm storing large amounts of primitive shapes data in memory like cubes. I do have large amounts of them (around 30 million) and i've lots of null (zero) entries around. Given that my each entry costs 1-bytes of

Set stage vanishing point in Flash via actionscript 3

此生再无相见时 提交于 2020-01-03 16:44:03
问题 I'm working with a few designers, each of whom have created 3D animations (using fp 10 capabilities) for use in the same flash application. Each 3D animation is a unique movieclip that will ultimately be part of the same .fla file. The problem I'm having is that each of the movieclips was created in a separate .fla, and each .fla had different settings for the vanishing point for the stage. This means that after importing the various moveiclips into my library, none of the visual assets are

Finding rotation between two congruent triangles

风格不统一 提交于 2020-01-03 12:22:10
问题 I'm working on a 3D mesh parsing tool. Currently, I'm trying to determine the rotation between two congruent triangles in 3D space—we'll call them ABC and DEF . I'm able to translate points A and D to the same location and now need to determine a rotation that would place DEF on the same plane and in the same orientation as ABC but I'm not familiar enough with the math to do it. Can anyone tell me how I can tackle this? I've been thinking of using the cross product of AB and DE to determine a

Receiving transformed mouse event data from DOM objects with a CSS 3D transform

痞子三分冷 提交于 2020-01-03 10:18:11
问题 Is there currently any data in a javascript mouse event that would allow me to easily find or calculate a mouse position relative to the 3D space of a transformed element? To illustrate visually, At left is the div without a 3d matrix, at right is the div after 3d transformation. o is the origin of the mouse event + /| / | +-----+ + | | | | | | o| => | o| | | | | +-----+ + | \ | \| + In the script below, clicking the same pixels in the div will report an event.layerX which is in the 2d

Building a hollow cube and filing it with small cubes in MATLAB

末鹿安然 提交于 2020-01-03 05:17:23
问题 I want to build a hollow cube with some dimensions x, y, and z, and fill its volume with many small cubes. The following image is similar to what I want to do, But, instead of small spheres, I want to use small cubes. After building the cube and filling it with other small cubes, I want to build a matrix that represents these small cubes inside the big one, this is because I want to be able to access every small cube, where I need to change its color . Is it possible to have this matrix

How to detect what side of a cube is clicked

♀尐吖头ヾ 提交于 2020-01-03 05:12:33
问题 Right now, I am trying to make a navigational menu, but to do this, I need to detect what side is clicked by the user. Is there any way to do this with raycasting, or if not, any other way? Here is my code if you need it: CodePen Link The short version is here var geometry = new THREE.BoxGeometry(200, 200, 200); var material = new THREE.MeshLambertMaterial( { color: 65535, morphTargets: true }); for (var i = 0; i < 8; i++) { var vertices = []; for (var v = 0; v < geometry.vertices.length; v++

MATLAB 4D (3d + color) plot with animation

混江龙づ霸主 提交于 2020-01-03 04:50:30
问题 I have 3 sets of 30 data points X,Y,Z. I would like to make the 4th dimension color. However the 4th dimension I want to use is a different length than my X,Y,Z (133 vs 30). This is a problem when using the scatter3 function in MATLAB, as the color dimension must match the size of X,Y,Z. I also want to animate this plot in .avi format, and have the 4th dimension (color) change as the movie progresses. Thanks in advance. 回答1: Create a 2D or 3D matrix to define your colors: 2D if you use colors

How to get visible size of DisplayObject with perspective projection

自闭症网瘾萝莉.ら 提交于 2020-01-03 04:47:08
问题 The following is entirely a math question. As we know, PerspectiveProjection delivers perspective transformations in 3D represented by the interdependent values of fieldOfView and focalLength according to the following formula: focalLength = stageWidth/2 * (cos(fieldOfView/2) / sin(fieldOfView/2) (source: bgstaal.net) Q: How to get the visible on-screen size of the DisplayObject (Cube on the above-linked image) to which PerspectiveProjection has been applied? A more thorough description and