How to draw curved polygon in ARKit? - ios

need to draw curved polygon in ARScene like on a picture
Using swift code only.
Any ideas ?

You can draw a curved Polygonal Model in ARKit/SceneKit using several polygons, not single one. For nice curvature 30 to 100 polygons needed.
But if you meant whether ARKit/SceneKit supports NURBS Models like Maya or 3dsMax does – the answer is NO. You have an API only for Poly Modeling.
For further information please read the following SO post.

Related

Can I draw great circle segment (geodesic) lines in Openlayers 3?

I want to plot lines between (distant) points on an Openlayers 3 map (which uses Open Street Map tiles). I want the lines to be seen as curves, as with flight paths, since they should take the shortest real world surface path: a geodesic (a great circle segment).
Is this possible?
Would I need to interpolate the points along the geodesic (how?) and plot a bunch of line segments, or is there an easier way? Is there something built in I can't find, or a library for it?
Looking at OL3's Flight Animation Example, it appears to be possible using the arc.js plugin: “A great circle arc between two airports is calculated using arc.js and then the flight paths are animated with postcompose. The flight data is provided by OpenFlights (a simplified data set from the Mapbox.js documentation is used).”

Polyline drawMapRect optimized drawing

I have lots of long polylines on a map.
I'd like to optimize their drawing, because at a few thousand points the polylines are drawn incredibly slow.
My drawMapRect looks like this :
- for each polyline segment
- verify if it's bounding box intersects the currently drawn MKMapRect
- if id does, draw it
Which does great if there aren't too many points. But when there are 8-16 maprects visible and 2-3000 points, they are incredibly slow running throught the for.
If they would be only locations, a solution would be to implement some kind of quadtree/r-tree structure and only filter for those locations in the currently drawn MKMapRect, but I'm not sure about if that would be appropiate for the polylines themselves.
If I filter only for the segment endpoints inside the current maprect, then some line segments might not be drawn. For example, the two red maprects between points 1-2 have no segment endpoints in them but still need to draw ...
Is there some kind of algorithm similar to quadtrees or some kind of approach for this problem ?
Unfortunately, I don’t know such a data structure that would allow to check line intersection with a rectangle.
However, one approach to solve the problem might be the following:
Draw all polylines in a map of very low resolution (a 2 dim array), and note for every pixel which polyline has drawn it. Then scan in this low-res map the relevant rectangles for drawn pixels, and store all relevant polylines. These can then be drawn in the full resolution map.
Maybe this approximate algorithm is faster than the precise algorithm that you use right now.
EDIT:
I assume you use for the polyline MKMapRect intersection check an effective algorithm such as shown in How to find the intersection point between a line and a rectangle?.

Drawing primitives like line, circle, polygon, nurbs in iOS

Are there any 3d engines for iOS that have a good set of APIs for drawing primitives such as lines, circle, rectangle, maybe even nurbs?
AFAIK, Irrlicht has a set functions to draw lines and rectangles, but that is it..
Specifically looking for something inside 3d engines so that it is easy to render and visualize 3d models plus provides a mechanism to add primitives to these 3d models on the fly.
Here are a few 3D game engines. Try using one of them:
SIO2 is pretty nice http://sio2interactive.com/
Unity3D has iOS support
Shiva3D (havent tried it out personally)
Check this link out as well.

Voxel Animation

I have been able to convert a 3D mesh from Maya into Voxel art (looks like a bunch of cubes--similar to legos), all done in Maya. I plan on using the 3D art to wrap around my 2D textures to make it 2.5D. My question is: does the mesh being voxelized allow me to use the pieces as particles that i can put into a particle engine in XNA to have awesome dynamic effects?
No, because you get a set of vertices and index defining triangles with no information about cubes.
But you can create an algorithm that extract the info from the model. It's a bit hard but it's feasible.
I'd do it creating a 3d grid, and foreach face I'd launch rays from that face to the opposite face, taking every collision with the mesh, getting for each ray a number of collisions that should be pair (0, 2, 4,...), this between two points should have a solid volume.
That way it can be converted to voxels... on each collision it would be useful to store the bones that are related to the triangle that collides, this way you would be able to animate the voxel model.

Is there any way to draw the Concave Polygon in Box2D and detect the collision with other shapes

I am beginner in Box2D physics engine. As I am having a Image with irregular curves I am trying to develop the polygon. But with the reference of the Raywenderlich demo tutorial using the Vertex Helper I am drawing the Polygon but in many cases it produces the concave polygon and when I am executing my Project it crashes.. So If can get some Help for the usage of the concave polygon it would be great.
Any help or suggestions appreciated. Thanks
#Marine; to use concave polygons you'll need to break it into smaller convex polygons. Just break the concave polygon into different convex polygons at the time of body creation and just create shapes for all those individual convex polygons.

Resources