surface

How to get rid of pygame surfaces?

In the following code, there is not just one circle on the screen at any given point in time. I want to fix this to make it so that it looks like there is only one circle, instead of leaving a smudge trail where ever the mouse cursor has been. import pygame,sys from pygame.locals import * pygame.init() screen = pygame.display.set_mode(...

How do I draw a texture-mapped triangle in MATLAB?

I have a triangle in (u,v) coordinates in an image. I would like to draw this triangle at 3D coordinates (X,Y,Z) texture-mapped with the triangle in the image. Here, u,v,X,Y,Z are all vectors with three elements representing the three corners of the triangle. I have a very ugly, slow and unsatisfactory solution in which I (1) extract a...

Is there any algorithm for projecting images onto a non-flat surface?

Is there any algorithm for projecting images onto a non-flat (deformed) surface? It is not deformed too much. It is a really glassy surface covered with high-quality, durable tracing paper. I have a 3-dimensional model of it. How can I texturise it with a projector? I want to write a program in C\C++\C# for Windows, which would be ...

Rendering Microsoft Surface Identity Tags in Java for Android

I want to write an application for Android devices that interacts with the surface and I need to be able to have the Android device display Microsoft Surface Identity Tags. I was able to create a class to draw the Byte Tags using the Byte Tag documentation but all I could find for the Identity Tags was this MSDN documentation and it doe...

Conversion from Iphone Core Surface RGB Frame into ffmepg AVFarme

Hello, I am trying to convert Core Surface RGB frame buffer(Iphone) to ffmpeg Avfarme to encode into a movie file. But I am not getting the correct video output (video showing colors dazzling not the correct picture) I guess there is something wrong with converting from core surface frame buffer into AVFrame. Here is my code : Surfac...

Texture mapping in MATLAB

I have points in 3D space and their corresponding 2D image points. How can I make a mesh out of the 3D points, then texture the triangle faces formed by the mesh? Update See answer ...

3D charting in Flex (surface)

Do you have any recommendation for a free 3D charting library in Flex. To be more precise, I only need to draw surface (for now). Basically, I just need a chart that displays three axes (one should be timeline, and two should be linear axises) and the surface. From what I have seen so far, two most popular free Flesh 3D libraries are Pa...

animation in Matlab

how to animate a surface if it's coordinates change in time (e.g. ellipsoid) using Matlab? ...

how to animate 2 surfaces in Matlab?

Hi everyone, I've written this code which makes an animation of 2 ellipsoids. Parameter k1 of these ellipsoids must depend on time (so they'd move asynchronously), but I need to animate them in one figure. Can I use loop for it or is it better to use timer & some kind of callback functions? The second problem - I need to move inner elli...

Generating Bezier Control Points for an object

Hello everyone, I'm trying to draw objects using Bezier surfaces with openGL's evaluators. I am struggling with defining the control points for my objects. Can anyone please suggest ways to get the control points for an object? Is there some program that I can use to design my object then import the control points into a file that I can...

In SDL, does SDL_Quit() free every surface?

Basically, on surfaces that are going to exist right until the program terminates, do I need to run SDL_FreeSurface() for each of them, or would SDL_Quit() take care of all this for me? I ask mainly because the pointers to a number of my surfaces are class members, and therefore I would need to keep track of each class instance (in a g...

How to improve the copy speed from D3D surface back to system memory

I'm using the following codes to copy D3D surface back to system memory, but the performance is bad when call LockRect operation, it spends lot of time of this function. Is there a way to improve it? Thanks in advance. Below is sample codes. D3DDev->GetRenderTargetData(renderTarget, offscreenSurface); // Lock the surface to read pixel...

Calling SDL_SetVideoMode several times

Is it ok to do the following? SDL_Surface* screen; screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE | SDL_RESIZABLE | SDL_FULLSCREEN ); screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE | SDL_RESIZABLE ); screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, ...

Negative coordinates in pygame

What would be the best way to use negative coordinates in pygame? At the moment I have a surface that is 1.5 times the original surface then everything that needs to be drawn is shifted up by a certain amount (to ensure the negative coordinates become positive) and drawn. Is there an easier/alternate way of doing this? ...

Algorithm for simplifying 3d surface?

I have a set of 3d points that approximate a surface. Each point, however, are subject to some error. Furthermore, the set of points contain a lot more points than is actually needed to represent the underlying surface. What I am looking for is an algorithm to create a new (much smaller) set of points representing a simplified, smoother...

subclassing view and implementing SurfaceHolder.Callback

Can I have a class that extends View and implements SurfaceHolder.Callback and inside this class have a SurfaceView object? If this is possible, then I’d have to call on the SurfaceView constructor like this: SurfaceView sview = SurfaceView(this) inside the constructor of View’s subclass. I can’t compile because of the foll error: ‘...

Relationship between Surface and Canvas: Android

What exactly is the relationship between a Surface and Canvas. Please explain. ...

draw smooth surface from 3D points via vtk

Hello every body. I have a set/cloud of 3D points of human face and want to draw a smoother surface using vtk. I have tried Delaunay triangulation but the result is not good. Thanks. ...

Surface Reconstruction from Contours with Quick Rescaling

I'm looking to construct a 3-D surface of a part of the brain based on 2-D contours from cross-sectional slices from multiple angles. Once I get this shape, I want to "fit" it to another set of contours via rescaling. I'm aspiring to do this in the context of an MCMC analysis, so it would be very nice if I could easily compute the volum...

Pygame - calling surface.convert() on animated sprite causes transparent background to become white.

Everyone says to use .convert() on surfaces to speed up animations (which will be an issue with my game because it will be and mmo...to some extent, so it might have a dozen or a couple dozen characters moving at the same time), the problem is that my transparent png images work great without convert but as soon as i use .convert() all o...