Search Results

Search found 8498 results on 340 pages for 'integrated graphics'.

Page 86/340 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • Extending a view to the left side, animated

    - by Heinrich
    Hi, I have a view that I want to extend on the left side using an animation. All borders but the left one should remain the same, so the x position and the width of the view are changing. I use this code: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:5.0]; self.frame = CGRectMake(self.frame.origin.x-100, self.frame.origin.y, self.frame.size.width+100, self.frame.size.height); [UIView commitAnimations]; If I run this code, the width of the view is set to the new value immediately and then the view is moved to the new x point, but why? How can I change this behaviour? Thanks for your ideas!

    Read the article

  • How to create lines with Athens?

    - by Kilon
    I have no clue how to create lines with Athens. I took a look at Cairo docs but I cant see how Athens is related to Cairo. http://zetcode.com/gfx/cairo/basicdrawing/ In the above link I cant find any equivalent for cairo_set_line_width(cr, 1); I tried to look inside Athens but is nowhere to be found. Overall I find the Athens architecture quite confusing though Cairo looks simple. Any idea how to makes this work ?

    Read the article

  • VB6 Game Development : Don't ask me why :-)

    - by CVS-2600Hertz-wordpress-com
    Hi All, I am developing a game in VB6 (plz don't ask me why :) ). The storyboard is ready and a rough implementation is underway. I am following a "pure-software-rendering" approach. (i.e. no DirectX, no openGL etc.) Amongst many others, the following "serious" problems exist: 2D alpha transparency reqd. to implement overlays. Parallax implementation to give depth-of-field illusion. Capturing mouse-scroll events globally (as in FPS-es; mapping them to changing weapon). Async sound play with absolute "zero-lag". Any ideas anyone. Please suggest any well documented library/ocx or sample-code. Plz do provide solutions with max performance and with as little overhead as possible. Also, anyone who has developed any games, and would be open to sharing her/his code would be highly appreciated. (any well-acknowledged VB games whose source-code i can study??) Thank You

    Read the article

  • Dynamically generate Triangle Lists for a Complex 3D Mesh

    - by Vulcan Eager
    In my application, I have the shape and dimensions of a complex 3D solid (say a Cylinder Block) taken from user input. I need to construct vertex and index buffers for it. Since the dimensions are taken from user input, I cannot user Blender or 3D Max to manually create my model. What is the textbook method to dynamically generate such a mesh? Edit: I am looking for something that will generate the triangles given the vertices, edges and holes. Something like TetGen. As for TetGen itself, I have no way of excluding the triangles which fall on the interior of the solid/mesh.

    Read the article

  • Objective C: Using UIImage for Stroking

    - by SeongHo
    I am trying to apply a texture for my brush but i'm really having a hard time figuring how it is done. Here's the image of my output. I used an UIImage that just follows the touch on the screen but when i swipe it faster the result is on the right side "W", and on the left side that's the result when i swipe it slow. i tried using the CGContextMoveToPoint and CGContextAddLineToPoint i don't know how apply the texture. Is it possible to use UIImage for the stroke texture? Here's my code UIImage * brushImageTexture = [UIImage imageNamed:@"brushImage.png"]; [brushImagetexture drawAtPoint:CGPointMake(touchCurrentPosition.x, touchVurrentPosition.y) blendMode:blendMode alpha:1.0f];

    Read the article

  • BlackBerry - Cropping image

    - by rupesh
    Hi all i want to crop a part of Image ,for that i am using following code: int x=20; int y=50; int [] rgbdata=new int[(0+width-x+height-y)* (image.getWidth())]; image.getARGB(rgbdata, 0, image.getWidth(), x, y, width, height); cropedImage=new Bitmap(image.getWidth(),image.getWidth()); cropedImage.setARGB(rgbdata, 0,image.getWidth(), 80,80, width, height); x an y are the position from where the cropping will be done in the rectangular form. but it is not working can any one help me out please. any sample code will work for me. its urgent. thanks in advance

    Read the article

  • Transform shape built of contour splines to simple polygons

    - by Cheery
    I've dumped glyphs from truetype file so I can play with them. They have shape contours that consist from quadratic bezier curves and lines. I want to output triangles for such shapes so I can visualize them for the user. Traditionally I might use libfreetype or scan-rasterise this kind of contours. But I want to produce extruded 3D meshes from the fonts and make other distortions with them. So, how to polygonise shapes consisting from quadratic bezier curves and lines? There's many contours that form the shape together. Some contours are additive and others are subtractive. The contours are never open. They form a loop. (Actually, I get only contour vertices from ttf glyphs, those vertices define whether they are part of the curve or not. Even though it is easy to decompose these into bezier curves and lines, knowing the data is represented this way may be helpful for polygonizing the contours to triangles)

    Read the article

  • Error during installation of Mesa on Linux

    - by rodnower
    Hello, I have a problem. I try to install Mesa 7.8 on CentOS 3.9 for i386 on VMVare 7.0.1 like described here: http://linux-sxs.org/multimedia/mesa.html When I perform configuration stage: ++++++++++++++++++++++++++++++++++++++++++++++++++ [root@CentOS Mesa-7.8]# ./configure --prefix=/usr --sysconfdir=/etc ++++++++++++++++++++++++++++++++++++++++++++++++++ (root is actualy root) This is what I get: ++++++++++++++++++++++++++++++++++++++++++++++++++ . . . checking pkg-config files for X11 are available... no checking for X... no configure: error: X11 development libraries needed for dri driver ++++++++++++++++++++++++++++++++++++++++++++++++++ (Three dots says that there is some output before) Put attention to error. Any idea? Thank you very much forahead.

    Read the article

  • Draw arrow on line

    - by Pete
    Hi, I have this code: CGPoint arrowMiddle = CGPointMake((arrowOne.x + arrowTo.x)/2, (arrowOne.y + arrowTo.y)/2); CGPoint arrowLeft = CGPointMake(arrowMiddle.x-40, arrowMiddle.y); CGPoint arrowRight = CGPointMake(arrowMiddle.x, arrowMiddle.y + 40); [arrowPath addLineToScreenPoint:arrowLeft]; [arrowPath addLineToScreenPoint:arrowMiddle]; [arrowPath addLineToScreenPoint:arrowRight]; [[mapContents overlay] addSublayer:arrowPath]; [arrowPath release]; with this output: http://yfrog.com/edschermafbeelding2010032p What have i to add to get the left and right the at same degree of the line + 30°. If someone has the algorithm of drawing an arrow on a line, pleas give it. It doesn't matter what programming language it is... Thanks

    Read the article

  • 3D Mesh Joining

    - by morlst
    I have 2 (or more) intersecting meshes, which require joining into 1 mesh object. I want to have some control over the resulting seam vertex insertion, so looking to write myself rather than use a library. Has anyone come across some open source code to base the algorithm on / ideas on the process? Initial impressions are: 1. Present in every 3D modelling program - mostly reinventing existing process (hence search for examples) 2. Potential for fiddly-ness around the polygon face direction and just touching conditions. (see above point)

    Read the article

  • Move an object in the direction of a bezier curve?

    - by Sent1nel
    I have an object with which I would like to make follow a bezier curve and am a little lost right now as to how to make it do that based on time rather than the points that make up the curve. .::Current System::. Each object in my scene graph is made from position, rotation and scale vectors. These vectors are used to form their corresponding matrices: scale, rotation and translation. Which are then multiplied in that order to form the local transform matrix. A world transform (Usually the identity matrix) is then multiplied against the local matrix transform. class CObject { public: // Local transform functions Matrix4f GetLocalTransform() const; void SetPosition(const Vector3f& pos); void SetRotation(const Vector3f& rot); void SetScale(const Vector3f& scale); // Local transform Matrix4f m_local; Vector3f m_localPostion; Vector3f m_localRotation; // rotation in degrees (xrot, yrot, zrot) Vector3f m_localScale; } Matrix4f CObject::GetLocalTransform() { Matrix4f out(Matrix4f::IDENTITY); Matrix4f scale(), rotation(), translation(); scale.SetScale(m_localScale); rotation.SetRotationDegrees(m_localRotation); translation.SetTranslation(m_localTranslation); out = scale * rotation * translation; } The big question I have are 1) How do I orientate my object to face the tangent of the Bezier curve? 2) How do I move that object along the curve without just setting objects position to that of a point on the bezier cuve? Heres an overview of the function thus far void CNodeControllerPieceWise::AnimateNode(CObject* pSpatial, double deltaTime) { // Get object latest pos. Vector3f posDelta = pSpatial->GetWorldTransform().GetTranslation(); // Get postion on curve Vector3f pos = curve.GetPosition(m_t); // Get tangent of curve Vector3f tangent = curve.GetFirstDerivative(m_t); } Edit: sorry its not very clear. I've been working on this for ages and its making my brain turn to mush. I want the object to be attached to the curve and face the direction of the curve. As for movement, I want to object to follow the curve based on the time this way it creates smooth movement throughout the curve.

    Read the article

  • Why are my lines getting thicker and thicker?

    - by mystify
    I try to draw some lines with different colors. This code tries to draw two rectangles with 1px thin lines. However, the second rectangle is drawn with 2px width lines, while the first one is drawn with 1px width. - (void)addLineFrom:(CGPoint)p1 to:(CGPoint)p2 context:(CGContextRef)context { // set the current point CGContextMoveToPoint(context, p1.x, p1.y); // add a line from the current point to the wanted point CGContextAddLineToPoint(context, p2.x, p2.y); } - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGPoint from, to; // ----- draw outer black frame (left, bottom, right) ----- CGContextBeginPath(context); // set the color CGFloat lineColor[4] = {26.0f * colorFactor, 26.0f * colorFactor, 26.0f * colorFactor, 1.0f}; CGContextSetStrokeColor(context, lineColor); // left from = CGPointZero; to = CGPointMake(0.0f, rect.size.height); [self addLineFrom:from to:to context:context]; // bottom from = to; to = CGPointMake(rect.size.width, rect.size.height); [self addLineFrom:from to:to context:context]; // right from = to; to = CGPointMake(rect.size.width, 0.0f); [self addLineFrom:from to:to context:context]; CGContextStrokePath(context); CGContextClosePath(context); // ----- draw the middle light gray frame (left, bottom, right) ----- CGContextSetLineWidth(context, 1.0f); CGContextBeginPath(context); // set the color CGFloat lineColor2[4] = {94.0f * colorFactor, 94.0f * colorFactor, 95.0f * colorFactor, 1.0f}; CGContextSetStrokeColor(context, lineColor2); // left from = CGPointMake(200.0f, 1.0f); to = CGPointMake(200.0f, rect.size.height - 2.0f); [self addLineFrom:from to:to context:context]; // bottom from = to; to = CGPointMake(rect.size.width - 2.0f, rect.size.height - 2.0f); [self addLineFrom:from to:to context:context]; // right from = to; to = CGPointMake(rect.size.width - 2.0f, 1.0f); [self addLineFrom:from to:to context:context]; // top from = to; to = CGPointMake(1.0f, 1.0f); [self addLineFrom:from to:to context:context]; CGContextStrokePath(context); }

    Read the article

  • UIBezierPath too many paths = too slow?

    - by HHHH
    I have a loop in which I'm adding many (10000+) lines to a UIBezierPath. This seems to be fine, but once I try and render the bezierpath, my device becomes extremely slow and jerky. Is this because I've added too many lines to my path? Adding lines to UIBezierPath - simplified: (this seems fine) [path moveToPoint:CGPointZero]; for (int i = 0; i < 10000; i++ ) { [path addLineToPoint:CGPointMake(i, i)]; } Rendering BeizerPath (Suggested by Rob) - this seems slow. - (void)drawBezierAnimate:(BOOL)animate { UIBezierPath *bezierPath = path; CAShapeLayer *bezier = [[CAShapeLayer alloc] init]; bezier.path = bezierPath.CGPath; bezier.strokeColor = [UIColor blueColor].CGColor; bezier.fillColor = [UIColor clearColor].CGColor; bezier.lineWidth = 2.0; bezier.strokeStart = 0.0; bezier.strokeEnd = 1.0; [self.layer addSublayer:bezier]; if (animate) { CABasicAnimation *animateStrokeEnd = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; animateStrokeEnd.duration = 100.0; animateStrokeEnd.fromValue = [NSNumber numberWithFloat:0.0f]; animateStrokeEnd.toValue = [NSNumber numberWithFloat:1.0f]; [bezier addAnimation:animateStrokeEnd forKey:@"strokeEndAnimation"]; } } Qs: 1) Is this because I'm adding too many paths too quickly? 2) I want to eventually draw many different lines of different colors, so I assume I would need to create multiple (10000+) UIBezierPaths - would this help or greatly slow the device as well? 3) How would I get around this? Thanks in advance for your help.

    Read the article

  • Merging and splitting overlapping rectangles to produce non-overlapping ones

    - by uj
    I am looking for an algorithm as follows: Given a set of possibly overlapping rectangles (All of which are "not rotated", can be uniformly represented as (left,top,right,bottom) tuplets, etc...), it returns a minimal set of (non-rotated) non-overlapping rectangles, that occupy the same area. It seems simple enough at first glance, but prooves to be tricky (at least to be done efficiently). Are there some known methods for this/ideas/pointers? Methods for not necessarily minimal, but heuristicly small, sets, are interesting as well, so are methods that produce any valid output set at all.

    Read the article

  • Generate texture from polygon (openGL)

    - by user146780
    I have a quad and I would like to use the gradient it produces as a texture for another polygon. glPushMatrix(); glTranslatef(250,250,0); glBegin(GL_POLYGON); glColor3f(255,0,0); glVertex2f(10,0); glVertex2f(100,0); glVertex2f(100,100); glVertex2f(50,50); glVertex2f(0,100); glEnd(); //End quadrilateral coordinates glPopMatrix(); glBegin(GL_QUADS); //Begin quadrilateral coordinates glVertex2f(0,0); glColor3f(0,255,0); glVertex2f(150,0); glVertex2f(150,150); glColor3f(255,0,0); glVertex2f(0,150); glEnd(); //End quadrilateral coordinates My goal is to make the 5 vertex polygon have the gradient of the quad (maybe a texture is not the best bet) Thanks

    Read the article

  • Edges on polygon outlines not always correct

    - by user146780
    I'm using the algorithm below to generate quads which are then rendered to make an outline like this http://img810.imageshack.us/img810/8530/uhohz.png The problem as seen on the image, is that sometimes the lines are too thin when they should always be the same width. My algorithm finds the 4 verticies for the first one then the top 2 verticies of the next ones are the bottom 2 of the previous. This creates connected lines, but it seems to not always work. How could I fix this? This is my algorithm: void OGLENGINEFUNCTIONS::GenerateLinePoly(const std::vector<std::vector<GLdouble>> &input, std::vector<GLfloat> &output, int width) { output.clear(); if(input.size() < 2) { return; } int temp; float dirlen; float perplen; POINTFLOAT start; POINTFLOAT end; POINTFLOAT dir; POINTFLOAT ndir; POINTFLOAT perp; POINTFLOAT nperp; POINTFLOAT perpoffset; POINTFLOAT diroffset; POINTFLOAT p0, p1, p2, p3; for(unsigned int i = 0; i < input.size() - 1; ++i) { start.x = static_cast<float>(input[i][0]); start.y = static_cast<float>(input[i][1]); end.x = static_cast<float>(input[i + 1][0]); end.y = static_cast<float>(input[i + 1][1]); dir.x = end.x - start.x; dir.y = end.y - start.y; dirlen = sqrt((dir.x * dir.x) + (dir.y * dir.y)); ndir.x = static_cast<float>(dir.x * 1.0 / dirlen); ndir.y = static_cast<float>(dir.y * 1.0 / dirlen); perp.x = dir.y; perp.y = -dir.x; perplen = sqrt((perp.x * perp.x) + (perp.y * perp.y)); nperp.x = static_cast<float>(perp.x * 1.0 / perplen); nperp.y = static_cast<float>(perp.y * 1.0 / perplen); perpoffset.x = static_cast<float>(nperp.x * width * 0.5); perpoffset.y = static_cast<float>(nperp.y * width * 0.5); diroffset.x = static_cast<float>(ndir.x * 0 * 0.5); diroffset.y = static_cast<float>(ndir.y * 0 * 0.5); // p0 = start + perpoffset - diroffset //p1 = start - perpoffset - diroffset //p2 = end + perpoffset + diroffset // p3 = end - perpoffset + diroffset p0.x = start.x + perpoffset.x - diroffset.x; p0.y = start.y + perpoffset.y - diroffset.y; p1.x = start.x - perpoffset.x - diroffset.x; p1.y = start.y - perpoffset.y - diroffset.y; if(i > 0) { temp = (8 * (i - 1)); p2.x = output[temp + 2]; p2.y = output[temp + 3]; p3.x = output[temp + 4]; p3.y = output[temp + 5]; } else { p2.x = end.x + perpoffset.x + diroffset.x; p2.y = end.y + perpoffset.y + diroffset.y; p3.x = end.x - perpoffset.x + diroffset.x; p3.y = end.y - perpoffset.y + diroffset.y; } output.push_back(p2.x); output.push_back(p2.y); output.push_back(p0.x); output.push_back(p0.y); output.push_back(p1.x); output.push_back(p1.y); output.push_back(p3.x); output.push_back(p3.y); } } Thanks

    Read the article

  • Breaking One Big Graphic of MutablePaths into CAShapeLayers

    - by StackOverFlowRider
    I have a class called GraphicView that takes a Graphic object and draws it in its drawRect method. This Graphic object is basically an array of mutablePaths that comprise an icon that I want drawn. For performance and other issues, I was thinking of taking this icon that is comprised of mutablePaths, and dividing it into a bunch of CAShapeLayers. I'm wondering is this possible? Considering the points for the mutablePaths of the icon are all interwoven together (ie the icon was initially an SVG file that I converted to code), is it possible to divide different parts of the icon into CAShapeLayers, and reassemble them all together when assigning to the views layer? If so how would it be done? If I assign them as sublayers to a CALayer or CAShapeLayer, will it understand to mesh them all together?

    Read the article

  • Does the iPhone 3G/3Gs camera put metadata in its images? (and how do you get it?)

    - by Ben Collins
    I've been trying to figure how whether the iPhone (either 3G or 3Gs) camera puts metadata into it's images. Anecdotally, it appears that it does (e.g., I've seen images posted on the web that included a bunch of metadata), but I can't find reference to it anywhere in the SDK documentation. So....does anyone have a definitive answer? Also, if there is metadata, how do I get at it?

    Read the article

  • Has anyone ever worked with a UX designer who also did the graphic design, is it a good combination?

    - by Ami
    I need to design a new framework for web based apps, including both UX guidelines and the art/graphic design guidelines such as what menus will look like, headers, colors, fonts etc. The UX designers I met, were unable to provide the artistic side, and the graphic designers didn't have the UX skills. Should I continue to look for one person with both skills, or is it better broken to two separate tasks?

    Read the article

  • how to dynamically recolor a CGGradientRef

    - by saintmac
    I have three CGGradientRef's that I need to be able to dynamically recolor. When I Initialise the CGGradientRef's the first time I get the expected result, but every time I attempt to change the colors nothing happens. Why? gradient is an instance variable ins a subclass of CALayer: @interface GradientLayer : CALayer { CGGradientRef gradient; //other stuff } @end Code: if (gradient != NULL) { CGGradientRelease(gradient); gradient = NULL; } RGBA color[360]; //set up array CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); gradient = CGGradientCreateWithColorComponents ( rgb, color, NULL, sizeof (color) / sizeof (color[0]) ); CGColorSpaceRelease(rgb); [self setNeedsDisplay];

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >