3d

ARKit – How to put 3D Object on QRCode?

℡╲_俬逩灬. 提交于 2020-12-27 08:36:16
问题 I'm actually trying to put a 3D Object on QRCode with ARKit For that I use a AVCaptureDevice to detect a QRCode and establish the area of the QRCode that gives me a CGRect . Then, I make a hitTest on every point of the CGRect to get the average 3D coordinates like so : positionGiven = SCNVector3(0, 0, 0) for column in Int(qrZone.origin.x)...2*Int(qrZone.origin.x + qrZone.width) { for row in Int(qrZone.origin.y)...2*Int(qrZone.origin.y + qrZone.height) { for result in sceneView.hitTest(CGPoint

Halcon - 3D equivalent of affine_trans_contour_xld

六眼飞鱼酱① 提交于 2020-12-13 04:40:05
问题 I have a XLD contour that i need to convert from world plane to image plane.. but I can only find affine_trans_contour_xld , that accepts a 2D Mat, and not a 3D mat.. how can I transform the xld Contour from the world plane to the image plane? basically what I need is the inverse of contour_to_world_plane_xld EDIT: I THINK that the solution would be to find the 2D Mat of the XY plane, but couldnt find how to do that either.. 回答1: I solved it this way: *get the points of a 100 mm square on my

How do I make 3D in pyglet?

混江龙づ霸主 提交于 2020-12-06 07:03:26
问题 I was trying to create using OpenGL, Python and pyglet, a flat triangle in 3D space, I saw some tutorials on the internet, some videos on YouTube, and in the end I wrote this code down there, the problem is that it did not work as I expected, I thought that if I tried to spin, I would see the triangle turning flat, and when I walked away, the triangle did not have to diminish? import pyglet from pyglet.gl import * config = Config(sample_buffers=1, samples=8) tela = pyglet.window.Window(height

matplotlib: grid in 3D plots

非 Y 不嫁゛ 提交于 2020-12-01 12:14:26
问题 In matplotlib , how can I show a grid in 3D scatter plot? In 2D plots I just do: plt.grid(True) and it works like a charm. Now with 3D plots the same call returns a warning: File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2792, in grid ret = gca().grid(b, which, axis, **kwargs) TypeError: grid() takes at most 2 arguments (4 given) How do I do this? 回答1: You can use the grid method of the axes to turn the grid on and off. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d

Smooth dynamically generated mesh in Unity?

自作多情 提交于 2020-12-01 07:11:37
问题 Given a mesh in Unity & C# (that itself was created in realtime by merging simpler base meshes), how could we during runtime* turn it into a smooth, almost like wrapped-in-cloth mesh version of itself? Not quite a fully convex version, but more rounded, softening sharp edges, bridging deep gaps and so on. The surface would also ideally look like when the "smoothing angle" normals setting is applied to imported objects. Thanks! Before & after sketch *The mesh setup is made by people and its

How to join these two 3D lines together with a surface in Python's matplotlib

筅森魡賤 提交于 2020-11-28 02:09:13
问题 I have two orbits which occur at different heights. I plot them in 3D, but I wish to join them together with a surface. So far I have this picture: which I get using this script: import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D font = {'size' : 18} matplotlib.rc('font', **font) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') #Read in data data = np.genfromtxt('mu8.txt') x, y = np.hsplit(data, 2) N = len(x) z = np.zeros

How to join these two 3D lines together with a surface in Python's matplotlib

流过昼夜 提交于 2020-11-28 02:08:31
问题 I have two orbits which occur at different heights. I plot them in 3D, but I wish to join them together with a surface. So far I have this picture: which I get using this script: import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D font = {'size' : 18} matplotlib.rc('font', **font) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') #Read in data data = np.genfromtxt('mu8.txt') x, y = np.hsplit(data, 2) N = len(x) z = np.zeros

HT for Web可视化QuadTree四叉树碰撞检测

我怕爱的太早我们不能终老 提交于 2020-11-21 04:10:10
QuadTree 四叉树顾名思义就是树状的数据结构,其每个节点有四个孩子节点,可将二维平面递归分割子区域。QuadTree常用于空间数据库索引,3D的椎体可见区域裁剪,甚至图片分析处理,我们今天介绍的是QuadTree最常被游戏领域使用到的碰撞检测。采用QuadTree算法将大大减少需要测试碰撞的次数,从而提高游戏刷新性能,本文例子基于 HT for Web 的图形引擎,通过 GraphView 和 Graph3dView 共享同一数据模型 DataModel ,同时呈现QuadTree算法下的2D和3D碰撞视图效果: http://v.youku.com/v_show/id_XODQyNTA1NjY0.html QuadTree的实现有很多成熟的版本,我选择的是 https://github.com/timohausmann/quadtree-js/ 四叉树的算法很简单,因此这个开源库也就两百来行代码。使用也非常简单,构建一个Quadtree对象,第一个参数传入rect信息制定游戏空间范围,在每次requestAnimationFrame刷新帧时,先通过quadtree.clear()清除老数据,通过quadtree.insert(rect)插入新的节点矩形区域,这样quadtree就初始化好了,剩下就是根据需要调用quadtree.retrieve(rect)获取指定矩形区域下