3d

Quaternion math for rotation?

孤者浪人 提交于 2020-01-01 09:24:46
问题 I'm drawing a flat disk using gluDisk() in my scene. gluDisk() draws the disk facing the positive Z axis but I want it to be facing some arbitrary normal I have. Clearly I need to use glRotate() to get the disk facing properly but what should be the rotation? I remember this can be calculated using Quaternions but I can't seem to remember the math. 回答1: The solution should be pretty straightforward, and shouldn't require quarternions. The axis of rotation to get from Normal1 to Normal2 must

3D image rotation in python

允我心安 提交于 2020-01-01 08:36:21
问题 I have the following image I1. I did not capture it. I downloaded it from Google I apply a known homography h to I1 to obtain the following image I2. I want to assume that a camera has taken this above shot of I2. I have found the camera matrix of this "camera". Let this camera matrix be k . Now, I want to rotate this image I2 about the camera axis. According to the explanation in the accepted answer in this question, I need to set the rotation matrix R and then perform k*R*inv(k)*h on image

How is xkcd doing xk3d? [closed]

你。 提交于 2020-01-01 07:33:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm amazed by today's 3D webcomics found at xkcd. How would he have done that? Would it require manually redoing every single comic or is there some way to automate it? Edit The 3D comics are still available on http://xk3d.xkcd.com 回答1: Each image is split into layers - each layer is its own PNG file and

What's faster for 3D? Perlin or Simplex noise?

你。 提交于 2020-01-01 06:08:47
问题 Okay, there are a lot of comparisons between Perlin and Simplex noise to be found on the web. But I really couldn't find one where there was a simple processing time comparison between both for three dimensions, which is what I am mostly interested in. I've read that popular PDF (and even understood most of it - yay!) but I cannot answer the simple question: Which one is faster for 3D, assuming an optimal implementation? This stackoverflow question answer suggests that Simplex is a pretty

OpenCV with stereo 3D reconstruction

丶灬走出姿态 提交于 2020-01-01 04:52:08
问题 Say I plan to use OpenCV for 3D reconstruction using a stereo approach...and I do not have any special stereo camera but only webcams. 1.)How do I build a cheap stereo setup using a set of web cams? 2.)Is it possible to snap two images using web cams and convert them to stereo using openCV API? I will use the stereo algorithm from the link below Stereo vision with OpenCV Using this approach I want to create a detailed mapping of an indoor environment. (I would not like to use any projects

Creating a cube with rounded corners in Three.js

耗尽温柔 提交于 2020-01-01 04:36:10
问题 Is it possible to create a cube with rounded corners of custom radius in three.js and then be able to texture that cube with an image? 回答1: You can round the corners of a cube using the Loop subdivision algorithm implemented in THREE.SubdivisionModifier . Here it is in action: http://threejs.org/examples/webgl_modifier_subdivision.html. You can texture this geometry just as you would texture any other geometry. three.js r.70 回答2: For a simple and straightforward example of subdivision

Exploded view algorithm for CAD

喜欢而已 提交于 2020-01-01 04:32:06
问题 I'm making a program to view 3D CAD models and would like to build in automated exploded views. All the assemblies that will be viewed are axi-symmetric. Some may not be, but the majority are. I'd like to figure out an algorithm for automatically moving parts in an assembly into an exploded view position. Here is an example of what I want to achieve through an algorithm (minus the labels of course): The only value I have to work with is the center of the bounding box of each part. If more

Make an object follow the camera in OpenGL

非 Y 不嫁゛ 提交于 2020-01-01 03:47:05
问题 I'm making a racecar game in OpenGL (just a small project) and I'm having problems trying to make my car follow the camera view. It wasn't hard to make it follow the camera as the camera moves forward and/or backward, but as I rotate the camera (look right or left) the car remais still. I mean, it still moves forward and backward but it's not in front of the camera (it's on the side). Here is my code (the part where I try to implement it): void updateCam() { gluLookAt(posX,posY + 0.025 * std:

Adding a legend to scatter3d plot

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 03:30:06
问题 One of the possible packages for interactive 3D plots is rgl. What I would like to do is to build 3D scatterplot with color coding according to some factor variable. The 3D dimensional scatterplot is for resulting loadings from plsr analysis. The resulting plot looks like The example data is given in a table: > loadings | Comp 1 | Comp 2 | Comp 3 | Class ------------------------------------------------------------------------------------------- TEMP | -0.0607044182964255 | "0.0437618450165671

How to convert points in depth space to color space in Kinect without using Kinect SDK functions?

烂漫一生 提交于 2020-01-01 01:15:06
问题 I am doing a augmented reality application with 3D objects overlay on top of color video of user. Kinect version 1.7 is used and rendering of virtual objects are done in OpenGL. I have manage to overlay 3D objects on depth video successfully simply by using the intrinsic constants for depth camera from the NuiSensor.h header and compute a projection matrix based on the formula I have found on http://ksimek.github.io/2013/06/03/calibrated_cameras_in_opengl/. The 3D objects rendered with this