Menu
  • HOME
  • TAGS

SurfaceTexture/Surface mapping with ANativeWindow

android,c++,android-ndk,textures,surface

I have a guess, although I've never used an ANativeWindow_Buffer. memcpy copies a certain number of bytes. How many bits per pixel is your image? If the value is greater than 8, you aren't transfering the full buffer. Since its probably 4 bytes per pixel (AARRGGBB), you probably need to...

How to fit a 3D surface to geographic coordinates?

matlab,matrix,surface

Do you mean: [a,b] = meshgrid(x,y); % z is your 100x1000 matrix mesh(a,b,z); ...

Set the pixel format AND create texture from surface in SDL

c++,pixel,sdl-2,surface,pixelformat

The SDL2 API provides the function SDL_ConvertSurface: SDL_Surface* SDL_ConvertSurface(SDL_Surface* src, const SDL_PixelFormat* fmt, Uint32 flags) You should be able to do surface = IMG_Load(filePath); // Call SDL_ConvertSurface to set the pixel format of the surface you have created. texture = SDL_CreateTextureFromSurface(renderer, surface); Reference: https://wiki.libsdl.org/SDL_ConvertSurface...

What does the return value of SurfaceTexture.getTransformMatrix mean, who can explain?

android,matrix,crop,surface

It's a GLES-compatible transformation matrix that may be used to rotate or flip an image. Generally speaking you just pass it through to whatever is going to render the GLES texture that SurfaceTexture creates. You can see examples of it used in Grafika; search for it in ContinuousCaptureActivity.java, CameraCaptureActivity.java, and...

How to go from raw Bitmap data to SDL Surface or Texture?

c++,bitmap,textures,sdl,surface

SDL_LoadBMP_RW is for loading an image in the BMP file format. And it expects an SDL_RWops*, which is a file stream, not a pixel buffer. The function you want is SDL_CreateRGBSurfaceFrom. I believe this call should work for your purposes: SDL_Surface* surface = SDL_CreateRGBSurfaceFrom( pixels, // dest_buffer from CopyTo width,...

how to create a 3D height map in python

python,matplotlib,plot,3d,surface

Even if I agree with the others that meshgrids are not difficult, still I think that a solution is provided by the Mayavi package (check the function surf) from mayavi import mlab mlab.surf(Z) mlab.show()...

Plotting a 3D Cylindrical Surface plot in Python

python,matplotlib,plot,3d,surface

Apparently, after some trial and error, the best/easiest thing to do in this case is to just to convert the r, theta, and z data points (defined as 2D arrays, just like for an x,y,z plot) into cartesian coordinates: # convert to rectangular x = r*numpy.cos(theta) y = r*numpy.sin(theta) z...

Calculate how many times a static number fits into another number

php,math,numbers,calculator,surface

It's simple. With this method, you can use any number and any size of materials. Store your materials into an array. Loop through on that array, make the calculations, and store the "rest" in another variable. If at the end there will be some rest, then add 1 more from...

Plotting a function of Theta and Phi as a color plot on a sphere

matlab,surface

This does it partially: T0 = 2 ; T1 = 30 ; T2 = 120 ; %// set your boundary conditions here [X,Y,Z] = sphere(50) ; %// generate coordinates of a sphere hs = surf(X,Y,Z) ; %// display the sphere and retrieve the handle to the graphic object axis equal...

MATLAB - Plot multiple surface fits in one figure

matlab,plot,colors,3d,surface

Edit Here is an edited version of my initial answer. The output of plot is a two-element graphical object, so you have to call separately h(1) and h(2) to set the properties of the plane and of the data points. Here is the code for the function: function [fitresult, gof,...

Surface 3 + Android emulator?

android,android-emulator,emulator,surface

Yes, the Surface 3 has an Intel x7 Atom processor, so it will run everything that your Windows desktop would run. Might I also recommend that you take a look at the Visual Studio Emulator for Android? It's fast, free, and uses Hyper-V, so it will work even better with...

TypeError: must be pygame.Surface, not list

python,pygame,surface

Problem is in line pygame.draw.rect(color Where color is list. draw.rect need Surface as first argument. pygame.draw.rect() draw a rectangle shape rect(Surface, color, Rect, width=0) -> Rect Draws a rectangular shape on the Surface. The given Rect is the area of the rectangle. The width argument is the thickness to draw...

Surface plot piping to gnuplot from C

c,2d,gnuplot,surface,piping

To get a surface plot you must separate two blocks with equal x-values, but changing y-value (or vice versa) by a blank line: x1 y1 z11 x1 y2 z12 ... x1 yN z1N x2 y1 z21 x2 y2 z22 .. x2 yN z2N x3 y1 z31 ... i.e. print a...

Combobox item does not updates when the property changes

c#,wpf,xaml,mvvm,surface

public class ComboBoxItem { private string displayName; private int value; public int Value { get { return this.value; } set { this.value = value; } } public string DisplayName { get { return displayName; } set { displayName = value; } } public ComboBoxItem() { } public ComboBoxItem(string name,...

Email from excel not working in window 8 2013 issue

excel,vba,windows-8,outlook,surface

What Outlook version do you have installed on the PC? Did you check out the Trust Center settings in Outlook? In general, your code is correct, I don't see anything strange... The How to automate Outlook from another program article describes the required steps for automating Outlook. Be aware, the...

Surface construction with point cloud 3D model in opengl

opengl,3d,mesh,point-clouds,surface

I have now created the point cloud of the shoe but have no idea how to construct the surface of it. How did you construct the point cloud? 3D scan? If so, there are a lot of programs specifically designed for surface reconstruction from point clouds. I suggest you...

MATLAB cftool surface plot matrix

matlab,surface,hacking

As a possible workaround (potentially not very efficient) is to plot the output of the fit (fitresult) and fetch the XData, YData and ZData properties of the plotted surface. For example, after performing a dummy fit: hP = plot(fitresult) yields those properties for hP: Surface (curvefit.gui.FunctionSurface) with properties: EdgeColor: [0...

Treating 2d array data as pixels defining a shape - is it possible to create an inside and a surface?

python,arrays,matrix,pixel,surface

You can just check the value and the direct neighborhood of every pixel: Your resulting image is 1 where: the original value was 1 and at least one neighbor is 0 It is 0 everywhere else. The image below might help to illustrate what I mean: The center pixel of...

Does Surface Pro 3 run Visual studio , sql server , xampp and other development apps?

sql-server,visual-studio,visual-studio-2013,xampp,surface

Surface Pro 3 with the i5 or i7 processor runs Windows 8.1 and can run these applications, just like a regular laptop or desktop. This should not be confused with the older Surface RT. I run SQL Server and Visual Studio on my Surface Pro 3 but can't speak from...

Displaying surface with non-rectangular boundary

matlab,image-processing,plot,3d,surface

Setting those values to NaN should do. Here's an example: [x, y] = ndgrid(linspace(-1,1,500)); z = cos(2*pi*(x+y)*2); z(x.^2+y.^2>1) = NaN; %// remove values outside unit circle surf(x,y,z,'edgecolor','none') colorbar view(2) axis equal ...

Stacking of several Surface plots in 3D-View

r,plot,3d,surface

I found an alternative approach: With the package rgl I and the function surface 3D I can stack several 3D-Surface plots within one open3d-window. Lets look at a small example: library("rgl") data2_I<-matrix(c(1.0,1.0,0.6,0.6,0.7,0.9,0.9,0.5,0.5,0.5,0.7,0.9,0.9,0.6,0.3,0.4,0.7,0.9,0.9,0.7,0.5,0.5,0.6,0.9,0.9,0.7,0.6,0.6,1.0,1.0), nrow=5) data0_I<-matrix(c(1.0,1.0,0.6,0.6,0.7,0.9,0.9,0.5,0.5,0.5,0.7,0.9,0.9,0.6,0.3,0.4,0.7,0.9,0.9,0.7,0.5,0.5,0.6,0.9,0.9,0.7,0.6,0.6,1.0,1.0), nrow=5) data1_I<-2*data0_I...

Wanting to write an app for surface pro tablet

windows-8,surface

Windows Store apps work for all tablets (ecen on devices without touch), not only the Surface. Run Visual Studio and create a new Windows Store App project.

Display the maximum surface in matplotlib?

matlab,matplotlib,plot,surface

I was goign to think about some dirty hacks like mgab mentions in their answer, but then decided just to go a considerably simpler route: You can get a similar effect purely by using transparency, you just have to make sure the transparency is low enough, otherwise you still get...

colliderect() triggers unexpectedly

pygame,collision-detection,python-3.4,rect,surface

I think I understand what's going on here: Your class Worm consists of an object that contains a list of xy-tuples, one for each pixel it occupies. The 'worm' creeps across the playfield, adding the next pixel in its path to that list and discarding excess pixel locations when it's...

Matplotlib parametric surface plot unexpected results, why?

python,matplotlib,3d,surface,parametric-equations

Why did you change the parametrization? Starting with the sphere as an example, you only have to change the semi-axis lengths: # Ellipsoid u = np.linspace(0, 2.*np.pi, 100) v = np.linspace(0, np.pi, 100) x = 60 * np.outer(np.cos(u), np.sin(v)) y = 20 * np.outer(np.sin(u), np.sin(v)) z = 10 * np.outer(np.ones(np.size(u)),...

Greyscale image in SDL2

c++,sdl,sdl-2,grayscale,surface

SDL_CreateRGBSurfaceFrom() does not handle 8-bit true color formats. As you noted, it creates a blank palette for 8-bit depths. The most obvious thing to do is to fill in the palette and just let it do its thing. Here's some code for a grayscale palette: SDL_Color colors[256]; int i; for(i...

How to plot a 3D surface in matlab using set of data [duplicate]

matlab,plot,matlab-figure,surface

What format is your data in and what kind of plot do you want? Once you have separated the data into 3 variables it is simple to plot it into a 3-D scatter plot and specify the color using: scatter3(X,Y,Z,S,C) More info is available on the mathworks website which is...

Quadratic fitted line doesn't appear in R plot

r,ggplot2,surface,quadratic

Hi there a lot of things that does not work in your code, so it is not clear what you want to do or what you are trying to fit. You should try this code plot(surft, mf, type="p", xlab="Mole fraction ethylene glycol", ylab="Surface tension / mN/m") ft = fitted(fit) lines(surft,...

Best Way to Hide/Show Multiple Surfaces with RenderControllers

javascript,famo.us,surface

If you wanted to iterate through your surfaces and hide one at a time, you could do something like the following code shows. Example jsBin Here function _hideNext(index) { if (index === surfaces.length) { //do something final, now complete _showNext(0); } else { var rc = surfaces[index][1]; var surface =...

How can I smooth a surface in MATLAB?

matlab,matlab-figure,surface

One option is to use conv2 on your vq data to smooth, then downsample as @Ander suggested: n = 5; % averaging size vq_2 = conv2(vq, ones(n)/n.^2,'same'); mesh(xi(1:20:end,1:20,end),yi(1:20:end,1:20,end),vq_2(1:20:end,1:20,end)) There will be a bit of an edge effect as by default conv2 pads with zeros....

MATLAB - 3D surface plot

matlab,plot,3d,surface

Here's another way of building patches. You specify a structure with the points (vertices), then the faces (which points do they include), then a vector of color (your sigma values), then you send the lot to the patch function which will take care of the rest. Then you finalise the...

3D alpha shape yielding unexpected convex hull of surface

cgal,delaunay,surface,lidar

You need to find the tetrahedons on the surface of the shape first. Then you can try alpha shapes and remove the edges exceeding alpha. In CGAL you Then check all tetrahedons if they are connected with a super tetrahedon. These are the tetrahedons on the surface of the shape....

Gnuplot 3D - plot scatter points and a surface *and* lines between the them

plot,3d,gnuplot,surface,scatter3d

You can do the calculations inside gnuplot's using statement. For the lines I use the vectors plotting style, and with arrowstyle variable (or linecolor variable) you can select different colors depending on the dz value: set style arrow 1 linecolor rgb 'red' nohead set style arrow 2 linecolor rgb 'green'...