Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm interested in creating a game that uses fractal maps for more realistic geography. However, the only fractal map programs I have found are Windows-only, for example Fractal Mapper. Needless to say, they are also not open-sourced.
Are there any open-sourced fractal map creators available, preferably in Python or C/C++? Ideally I would like something that can be "plugged into" a program, rather then being standalone.
Fracplanet may be of use.
Basic terrain generation involves creating a height map (an image) and rendering it using the pixel colour as height. So you may find image or texture generation code useful. This is a good tutorial.
For the terrain aspect take a look at libnoise.
It's packaged for Debian, and has excellent documentation with a chapter on terrain generation with example C++ code.
Of course there's a lot more to "maps" than slapping some colours on a height field (for example Fracplanet adds rivers and lakes). And the sort of terrain you get from these methods isn't actually that realistic; continents don't generally ramp up from the coast into a rocky hinterland, so maybe simulating continental drift and mountain building and erosion processes would help (alternatively, fake it). And then if you want vegetation, or the artefacts of lifeforms (roads and towns, say) to populate your map you might want to look at cellular automata or other "artificial life" tools. Finally, the Virtual Terrain Project is well worth a browse for more links and ideas.
I'd highly recommend purchasing a copy of
Texturing & Modeling: A Procedural Approach
I see it's now in it's third edition (I only have the second) but it's packed full of useful articles about the use of procedural texturing including several chapters on their use in fractal terrains. It starts out with extensive discussion of noise algorithms too - so you have everything from the basics upwards. The authors include Musgrave, Perlin and Worley, so you really can't do better.
If you want truely realistic geography, you could use NASA's SRTM dataset, perhaps combined with OpenStreetMap features. :-)
A very simple implementation would be to use the midpoint displacement fractal, http://en.wikipedia.org/wiki/Diamond-square_algorithm, or the somewhat more complicated Diamond-Squares algorithm.
http://www.gameprogrammer.com/fractal.html#diamond
These are similar algorithms to the "Difference cloud" in Photoshop.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have the need to replicate GPU tessellation on the CPU (ie get the same uvw coordinates on the CPU side as I will get on the GPU from the tessellator).
The reason for this is rather complicated, but simply put I have an algorithm that stores data per tessellation point, and to calculate it in the first place I need the uvw coordinates on the CPU.
I have googled a lot for the exact details of the tessellation pattern, but I only find very vague texts speaking about it in a general nature, the best one being this one: http://fgiesen.wordpress.com/2011/09/06/a-trip-through-the-graphics-pipeline-2011-part-12/
Is the reason for the lack of texts on this that it's vendor dependent, or have I simply not found the not found the right page?
I'm interested in texts both on the OpenGL and DX11 implementation, if they differ.
I was also very interested by tessellation, and specifically subdivision surfaces some time ago. This is a very complicated topic. It was researched from early 70th and it's still in research.
It isn't clear if you want to re-implement whole shader tessellation pipeline (which I think will take years for a single programmer) or just a single subdivision algorithm (or even algorith that isn't subdivision).
Anyway, there is some links about subdivision:
Theory
Typically we implement subdivision surfaces in tessellation shaders using Catmull–Clark subdivision surface algorithm. You can find some papers from original authors in Google. There is main one:
"Recursively generated B-spline surfaces on arbitrary topological meshes" (year 1978, PDF)
Closer to code
Check papers of those cool guys from Microsoft Research:
Charles Loop - (BTW, author of another subdiv algorithm), purely mathematical stuff
Hugues Hoppe - Look for "progressive meshes", much more close to software
Even more closer to code.
You can find some libraries on the web. When I searched a while ago, there was a dozen of libs, that implemented subdivision on CPU. I didn't look they much, because I was interested in GPU implementation. The keyword for search is "subdivision lib" =)
The most interesting one is Pixar's OpenSubdiv. Take a look at their code.
Also look at "NVIDIA Instanced Tessellation" Sample (DirectX, OpenGL). They've implemented tessellation pipelne in Vertex and Geometry shaders.
Hope it helps!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
CGAL seems to do just about everything I need and a little more for my upcoming project. It can create polygons out of arc line segments and run boolean operations on them. It has spatial sorting packages already that would save me a lot of time regarding a few things and the whole library seems quite standardized and well planned.
There's just the issue with the license being QPL (GPL for the upcoming version 4.0) for most of the packages (except the very basic ones). I've got a meager budget and can likely not gather funds to buy the commercial licenses for those specific packages in CGAL that require it.
My specific needs of such a library would be:
Exact precision 2D euclidean space
Complex polygons
Polygons able to have curved line (arc) segments
Boolean operations on those polygons
Polygon offsetting
Polygon partitioning or effective triangulation
Inscribed area and polygon fitting algorithms
Possibly some spatial sorting structures with circular range searches
All in all, I'm looking for a well rounded 2D geometry C++ library with exact precision.
Preferably with MIT, LGPL at a stretch, or a low cost one-time royalty-free license below $500.
Boost got some basic structures down, but from what I can tell they lack a lot of the higher level functionality. Any libraries that has expanded on this? I would consider doing it myself, but I lack the expertise to do it well and it'd prolong my project by quite a bit.
Just to be clear, I'm not looking for a 2D graphics library, just pure geometry structures.
Have a look at Wykobi.
It is a templated library and you can template the dimension as 2D.
It is distributed under the MIT License.
Take a look at Geometric Tools for Computer Graphics.
Refined over a decade
Unbelievably good documentation, both in hard bound and extensively in PDF form
Boost license
It meets all your requirements:
Exact precision 2D euclidean space: Yes
Complex polygons : Yes
Polygons able to have curved line (arc) segments : Nonsensical. By
definition, polygons are composed of line segments. If you are
looking for splines and NURBS, the library has them.
Boolean operations on those polygons : Yes
Polygon offsetting : Unclear what you mean. The library certainly supports translation.
Polygon partitioning or effective triangulation: Yes, Delaunay triangulation
and Voronoi regions
Inscribed area and polygon fitting algorithms :Yes
Possibly some spatial sorting structures with circular range searches : Yes, spatial sorting and a whole bushel of intersection functions.
All this comes from the book Geomtric Tools for Computer Graphics by Schneider and Eberly. The book is outstanding, with clear presentation of how the algorithms work and what their limitations are. The authors have made the code available online under the Boost license and include most (all?) of the book online as a PDF to accompany each code module. They maintain an very useful website that is indexed in various ways.
I have no connection to the authors nor any monetary interest. I used their book in my thesis and it was extremely pleased with it as an easy to use reference and a powerful library.
Have you looked at Boost.Geometry library? It's nowhere near CGAL in terms of functionality, but it might help you.
You could try GeoLib www.geolib.co.uk. Not as much functionality but does offer boolean operations and is very easy to use.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am trying to pick a physics engine for a simple software application. It would be to simulate a rather small number of objects so performance isn't a huge concern. I am mostly concerned with the accuracy of the motion involved. I would also like the engine to be cross-platform between windows/linux/mac and usable with c++ code. I was looking at Bullet, Newton Game Dynamics, and ODE because they are open source. However, if Havok/PhysX are significantly more accurate I would consider those too.
All I seem to find are opinions on the engines, are there any thorough comparisons between the options? Or does anyone have experience trying the various engines out. Since what I'm trying to do is relatively simple there probably isn't a huge difference between them, but I'd like to hear what people have to say about the options? Thanks!
There is a nice comparison of ODE and Bullet here:
http://blog.wolfire.com/2010/03/Comparing-ODE-and-Bullet
Hope it can be useful in making a choice.
Although it is a bit dated, there is a comprehensive comparison of (in alphabetical order) Bullet, JigLib, Newton, ODE, PhysX, and others available here:
http://www.adrianboeing.com/pal/papers/p281-boeing.pdf
The comparison considers integrators, friction models, constraint solvers, collision detection, stacking, and computational performance.
Sorry, but you will never find a real comparison with respect to accuracy. I am searching for three months now for my master thesis and have not found it. So I started to do the comparison on my own but it's still a long way to go. I'm testing with 3d engines and even 2d engines and for now Chipmunk is the one with the highest accuracy so far. So if you have no need for 3d I would reccomend it. However if you have an urgent need for 3d and your problem is as simple as you described it (don't want to expand it in the future?) Bullet and ODE will do it. I would prefer Bullet because it is much more up-to-date and is still actively maintained. At least there is Newton, with which I am fighting right now. Therefore I can't give you pros and cons except that it is a bit more work to get familiar with the (crucial) bad documentation.
Hope that helps. Best regards.
One thing I found really valuable in ODE is the ability to change pretty much every single parameter 'on the fly'. As an example, the engine doesn't seem to complain if you modify the inertia or even the shape of a body. You could replace a sphere with a box and everything would just keep working, or change the size of the sphere.
Other engines are not as flexible usually, because they do a lot of work internally for optimization purposes.
As for accuracy, as far as I know, ODE still supports a very accurate (but slow) solver which is obviously not very popular in the games industry because you can't play around with more than 25-30 objects in real time. Hope this helps.
Check out Simbody, which is used in engineering. It's particularly good for simulating articulated bodies. It has been used for more than 5 years to simulate human musculoskeletal dynamics. It's also one of the physics engines used in Gazebo, a robot simulation environment.
https://github.com/simbody/simbody
http://nmbl.stanford.edu/publications/pdf/Sherm2011.pdf
A physics abstraction layer supports a large number of physics engines via a unified API, making it easy to compare engines for your situation.
PAL provides a unique interface for these physics engines:
Box2D (experimental)
Bullet
Dynamechs(deprecated)
Havok (experimental)
IBDS (experimental)
JigLib
Meqon(deprecated)
Newton
ODE
OpenTissue (experimental)
PhysX (a.k.a Novodex, Ageia PhysX, nVidia PhysX)
Simple Physics Engine (experimental)
Tokamak
TrueAxis
According to the December 2007 paper linked in this answer:
Of the open source engines the Bullet engine provided the best results
overall, outperforming even some of the commercial engines. Tokamak
was the most computationally efficient, making it a good choice for
game development, however TrueAxis and Newton performed well at low
update rates. For simulation systems the most important property of
the simulation should be determined in order to select the best
engine.
Here is a September 2007 demo by the same author:
https://www.youtube.com/watch?v=IhOKGBd-7iw
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Does anyone know what's the best graphic drawing library for C++, I want a lib that can draw basic shapes and can make image editing, gradients and vector or 3D would be great to.
The windows drawing functions are complicated and are not very advanced.
May I suggest using Cairo?
This vector library is very fast, verbose and powerful! Just look at those pretty examples!
There's even integration with OpenGL if you need vectorized 3D textures!
I tested AGG, Cairo, GDI+ and Quartz (for Mac).
I think Quartz is the best, but is available (as long as I know) for Mac only.
AGG is poweful, but is not well documented. The developer decided to reinvent the wheel, and made his own doc system, instead of using something standard like doxygen. There are good tutorials for basic understanding, but when you dig deeper you find API documentation lacking, imprecise or incomplete.
GDI+ is pretty basic compared to the others, and is available for Windows only.
As a result, I think the best choice is probably Cairo (unless you can choose to develop for Mac only). It's well documented, the code is clean, and is fast and powerful.
Check out CImg Library.
CImg stands for "Cool Image" : It is
easy to use and efficient. It's a very
pleasant toolbox to code image
processing stuffs in C++, and
potentially covers a wide range of
image processing applications.
Graphics libraries OpenGL, DirectX and game engines such as Ogre3D may be too low level for tasks like drawing shapes and gradients.
Maybe you should take a look at Cairo as mentioned above (http://cairographics.org/), or simply at Qt which has a pretty complete and efficient drawing module (http://qt.nokia.com/doc/4.5/examples.html#graphics-view) and allows high level (GraphicsScene & GraphicsView) and low level (OpenGL) drawing.
For 2D drawing, SFML provides a nice API.
See some of the quality tutorials to learn more.
DirectX and OpenGL are two options here. They're both complicated though.
Though meant for 3D you can get to do 2D stuff with Ogre3D
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Basically, I'm looking for a library or SDK for handling large point clouds coming from LIDAR or scanners, typically running into many millions of points of X,Y,Z,Colour. What I'm after are as follows;
Fast display, zooming, panning
Point cloud registration
Fast low level access to the data
Regression of surfaces and solids (not as important as the others)
While I don't mind paying for a reasonable commercial library, I'm not interested in a very expensive library (e.g. in excess of about $5k) or one with a per user run-time license cost. Open source would also be good. I found a few possibilities via google, but they all tend to be too expensive for my budget.
Check Point Cloud Library (PCL). It is quite a complete toolkit for processing and manipulating point clouds. It also provides tools for point clouds visualisation: pcl::visualization::CloudViewer which makes use of VTK library and wxWidgets
Since 2011, point clout translation (read/write) and manipulating toolkit has been developed: PDAL - Point Data Abstraction Library
I second the call for R which I interface with C++ all the time (using e.g. the Rcpp and RInside packages).
R prefers all data in memory, so you probably want to go with a 64bit OS and a decent amount of RAM for lots of data. The Task View on High-Performance Computing with R has some pointers on dealing with large data.
Lastly, for quick visualization, the hexbin is excellent for visually summarizing large data sets. For the zooming etc aspect try the rgl package.
Why don't you go have a look at the R programming language which can link directly to C code, thereby forming a bridge. R was developed with statistical code in mind but can very easily help not only to handle large datasets but also visualize them as well. There are quite a number of atmospheric scientists who are using R in their work. I know, I work with them for exactly the stuff you're trying to do. Think of R as a poor man's Matlab or IDL (but soon won't be.)
In spirit of the R answers, ROOT also provides a good undeling framework for this kind of thing.
Possibly useful features:
C++ code base and the Cint c++ interpreter as the working shell. Python binding.
Can display three dim point clouds
A set of geometry classes (though I don't believe that they support all the operations that you need)
Developed by nuclear and particle physicists instead of by statisticians :p
Vortex by Pointools can go up to much higher numbers of points than the millions that you ask for:
http://www.pointools.com/vortex_intro.php
It can handle files of many gigabytes containing billions of points on modest hardware.