Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have generated points like this and now I what to connect all these points into one model - spring. How can I achieve this? I've tried iterating through each point and build it from polygons or triangles but I have failed.
I have set of rings where each ring was build from points which coords I have.
You probably want to treat these as generalized cylinders and tessellate a triangle mesh. This can be done by sweeping a circle along the path. Some of the details are tricky since undefined tangents can lead to unexpected twists in your triangle mesh. You might want to study the GLE library or the TubeGeometry implementation in ThreeJS.
For simplestic rendering, note that OpenGL has GL_LINE_STRIP. It also has glLineWidth, although many platforms have a max width of 1. You would need to take care to use separate draw calls for seperate springs, otherwise they'll be connected.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
This is my array of arraylist: Arraylist[] a = new Arraylist[SIZE];
I’m struggling with writing it in my UML diagram, how can I write it?
With or without the <>?
The simplest way is to define it this way:
a is of type Arraylist (after the colon) with multiplicity 0..* and its default (after the equal sign) is Arraylist[SIZE].
As commented by #bruno the default value is a bit of interpretation. UML basically should be held language agnostic, but sometimes you just want to point out implementation details (for whatever reason). So you can add the new keyword right in front of the Arraylist[SIZE]. What that actually means is language dependent (and so out of a general scope I like to stick to).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
When I create a symbol layer the text field is wrapped if the text becomes too long. I'm not able to figure out why/when the text is to long. It seems to depend on different things e.g. font type, text size and text length.
I tested the text length by using this example code. I replace Cafeteria with the alphabet with space between each character. It then wraps to a second line between m and n and that's to few letters on one line for our use case. https://azuremapscodesamples.azurewebsites.net/Symbol%20Layer/Formatted%20text%20field.html
I have been working with mapbox. They have a setting "text-max-width" that solves this issue.
I have checked the javascript code that comes with the npm package azure-maps-control and it doesn't implement support for "text-max-width".
Do anyone know how to fix the wrapping issue or if the package azure-maps-control are going to implement support for the "text-max-width" setting?
There is no option for this today, but I've added it to the feature request list. As a work around, you could do the following:
var layer = new atlas.layer.SymbolLayer(datasource);
map.map.setPaintProperty(layer.getId(), 'text-max-width', 15);
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have 170 png images in a folder.
I want to load and store them in a matrix/array/cell array, so that i can easily access and modify them but I'm stuck at the very beginning.
How can I do it? Which is the best structure?
Assuming they are all the same size, in the folder containing the images:
list=dir('*.png'); % read all the .pngs in your folder
Image1=imread(list(1).name); % read the first image to calculate the dimentions of your stack
ImSize=size(Image1)
ImageStack=zeros(ImSize(1),ImSize(2),length(list)); % preallocate your stack with zeros
for ii=1:length(list)
Image=imread(list(ii).name
ImageStack(:,:,ii)=rgb2gray(Image); % copy an image in each step of the third dimsion of your stack
end
If you need the color information just add another dimension to ImageStack and forget the rgb2gray(). Hope that helps!
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 3 years ago.
Improve this question
I know there are already other posts about this, but I am unable to get the recommended libraries running.
I am writing a program in C. I am fairly inexperienced at programming. I need to plot the results on an x-y graph. There will be potentially hundreds or even thousands of points. The points will be plotted as the program calculates them, so the graph may need to scroll sideways if the x-axis is exceeded.
So, basically, what I need to do is open a window with x-y axes and plot points in this graph as my program comes up with the numbers. I am looking for the simplest and quickest way to get this written, and it's just a way for me to visualise the results. Can C handle this or do I need a library? If a library, I need one that is easy to set up as my experience is limited.
Thanks in advance
Andrew
If you look for a library to be linked into yours program then MathGL (cross-platform GPL plotting library) is better than gnuplot. At this, it can handle huge data sets, can collect plotting (i.e. add plot, add new plot, add new plot, ..., save current result/plot, add new plot, ..., save result). And MathGL have C interface too.
I'm a bit confused by words "so the graph may need to scroll sideways if the x-axis is exceeded". Because it is difficult to place a point (plot) if one don't know the final axis scale(s).
May be you need just a bitmap (or XPM image - 2D array of char) each row/column is proportional to time-step and the height of point is proportional to data value, like
h[i] = Height*(y[i]-ymin)/(ymax-ymin).
I would use gnuplot if on *nix
http://ndevilla.free.fr/gnuplot/
http://ndevilla.free.fr/gnuplot/gnuplot_i/index.html
Looks pretty easy to me
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Taking one camera and moving it around to take two images of the same object, from a different viewpoint, one should be able to compute a matrix that relates these two scenes. In OpenCV, how is this accomplished?
If said object is a calibration pattern like the chessboard used by OpenCV, then the camera calibration routine mentioned by ChrisO would give you both the camera intrinsics (focal length, principal point, and lens distortion) as well as the camera extrinsics (where they are relatively in space).
If you have general object, then you need to establish a set of 2D correspondences which you can feed into cvFindFundamentalMat. This finds the fundamental matrix which relates the two perspectives. Namely, for each point x in camera 1 and corresponding point x' in camera 2, x'Fx = 0. You can similarly find the epipoles, etc. This uses the 8 point algorithm which requires at least 8 point pairs of point correspondences.
You can get the correspondences either manually or with a robust feature extractor and matcher along the lines of MSER/Affine Harris + SIFT.