3d

Refraction in Raytracing?

扶醉桌前 提交于 2020-01-11 17:41:42
问题 I've been working on my raytracer again. I added reflection and multithreading support. Currently I am working on adding refractions, but its only half working. As you can see, there is a center sphere(without specular highlight), a reflecting sphere(to the right) and a refracting sphere(left). I'm pretty happy about reflections, it does look very good. For refractions its kinda working...the light is refracted and all shadows of the spheres are visible in the sphere(refraction index 1.4),

Given a surface normal, find rotation for 3D Plane

无人久伴 提交于 2020-01-11 17:27:06
问题 So I have a 3D Plane described by 2 Vectors: P : a point which lies on the Plane N : the surface normal for the Plane And i have a very large, flat square Polygon, which I want to render to represent this Plane. I can easily translate the polygon to the given point, but then I need to find the proper rotation to apply to make the surface normal actually be the surface normal. I tried a method mentioned else where which was: 1) Take any none parallel vector (V) to the normal (N), and take the

3D clustering Algorithm

三世轮回 提交于 2020-01-11 16:30:42
问题 Problem Statement: I have the following problem: There are more than a billion points in 3D space. The goal is to find the top N points which has largest number of neighbors within given distance R. Another condition is that the distance between any two points of those top N points must be greater than R. The distribution of those points are not uniform. It is very common that certain regions of the space contain a lot of points. Goal: To find an algorithm that can scale well to many

3D clustering Algorithm

纵饮孤独 提交于 2020-01-11 16:27:20
问题 Problem Statement: I have the following problem: There are more than a billion points in 3D space. The goal is to find the top N points which has largest number of neighbors within given distance R. Another condition is that the distance between any two points of those top N points must be greater than R. The distribution of those points are not uniform. It is very common that certain regions of the space contain a lot of points. Goal: To find an algorithm that can scale well to many

OpenGL dinosaur model bug: gluTessCallback issue

拟墨画扇 提交于 2020-01-11 12:25:11
问题 I am taking a computer graphics class that teaches us how to use OpenGL with the glut libraries. I have an idea for a final project that involves lighting and textures being put on a dinosaur model that I found online. My first step is to simplify the existing online code so I can begin working on my project. Unfortunately, the online code for this model is broken, and I cannot seem to figure it out. I am not sure what gluTessCallback does, but my program is very upset with two lines of this

MATLAB - 3D surface plot

吃可爱长大的小学妹 提交于 2020-01-11 11:49:25
问题 I have 20 data points in 3D space. Here you can see them plotted: clear all close all clc Data = [97.4993 104.3297 0.7500 196.7021 100.0000 105.0000 0.7500 290.9164 100.0000 107.5000 0.7500 142.1626 96.2569 106.4992 0.7500 143.3605 97.5028 104.3317 1.0000 197.1111 100.0000 105.0000 1.0000 290.4210 100.0000 107.5000 1.0000 144.0155 96.2530 106.4969 1.0000 144.0969 98.7055 104.8295 0.7500 239.7734 100.0000 106.2500 0.7500 214.6557 98.0627 107.2455 0.7500 145.4154 96.8781 105.4144 0.7500 161

Circle with Triangle strips

邮差的信 提交于 2020-01-11 10:26:35
问题 I have been trying to create a circle in OpenGL but I cannot use triangle fans because I have read they are not available in directx anymore and I will also be making directx calls. I could not really understand how triangle strips work. All my implementations had holes or weird quirks, can anybody help me out here, how can I implement it in the best possible way? Also is there really any performance difference between triangle strips and seperate triangles, for lets say 10 circles with 1000

3D lines intersection algorithm

杀马特。学长 韩版系。学妹 提交于 2020-01-11 10:22:08
问题 I have line direction using x,y,z and two points A, B , I used line segment using B- A how to get the intersection point between them Best regards 回答1: Sytem of equations: The parametrice equation of a line with direction (a,b,c) and one point X(x1,x2,x3) is : D1:(x, y, z) = (x1, y1, z1) + t1(a, b, c) The parametrice equation of a line with 2 points A and B is : D2:(x, y, z) = (xa, ya, za) + t2(xb-xa, yb-ya, zb-za) you just need to equalize D1 and D2 to get the result finding the parameter t1

unity3d trouble with ship floating on water

有些话、适合烂在心里 提交于 2020-01-11 03:36:25
问题 In unity, i have a ship And i have also water: I want to make ship float on water, but(of course) what I get is this: Is there any good way to keep water out of the ship? Just want to make that water inside ship not displayable. Maybe there is already answer for my question over the internet, but I had no idea on what do I exactly type in google... and I had also no idea for title of this question, so please don't blame me for unclear title. Not it looks like this: I want it to look like this

Linear Least Squares Fit of Sphere to Points

删除回忆录丶 提交于 2020-01-10 14:37:42
问题 I'm looking for an algorithm to find the best fit between a cloud of points and a sphere. That is, I want to minimise where C is the centre of the sphere, r its radius, and each P a point in my set of n points. The variables are obviously Cx , Cy , Cz , and r . In my case, I can obtain a known r beforehand, leaving only the components of C as variables. I really don't want to have to use any kind of iterative minimisation (e.g. Newton's method, Levenberg-Marquardt, etc) - I'd prefer a set of