Search Results

Search found 2852 results on 115 pages for '2d'.

Page 15/115 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Trying to convert a 2D image into 3D objects in Java

    - by Kyle
    Hey, I'm trying to take a simple image, something like a black background with colored blocks representing walls. I'm trying to figure out how to go about starting on something like this. Do I need to parse the image and look at each pixel or is there an easier way to do it? I'm using Java3D but it doesn't seem to have any sort of built in support for that...

    Read the article

  • Java 2D clip area to shape

    - by user2923880
    I'm quite new to graphics in java and I'm trying to create a shape that clips to the bottom of another shape. Here is an example of what I'm trying to achieve: Where the white line at the base of the shape is the sort of clipped within the round edges. The current way I am doing this is like so: g2.setColor(gray); Shape shape = getShape(); //round rectangle g2.fill(shape); Rectangle rect = new Rectangle(shape.getBounds().x, shape.getBounds().y, width, height - 3); Area area = new Area(shape); area.subtract(new Area(rect)); g2.setColor(white); g2.fill(area); I'm still experimenting with the clip methods but I can't seem to get it right. Is this current method ok (performance wise, since the component repaints quite often) or is there a more efficient way? Thanks in advance.

    Read the article

  • Touch draw in Quatz 2D/Core Graphics

    - by OgreSwamp
    Hello, I'm trying to implement "hand draw tool". At the moment algorythm looks like that (I don't insert any code because methods are quite big, will try to explain an idea): Drawing In touchesStarted: method I create NSMutableArray *pointsArray and add point into it. Call setNeedsDisplay: method. In touchesMoved: method I calculate points between last added point from the pointsArray and current point. Add all points to the pointsArray. Call setNeedsDisplay: method. In touchesFinished: event I calculate points between last added point from the array and current point. Set flag touchesWereFinished. Call setNeedsDisplay:. Render: drawRect: method checks is pointsArray != nil and is there any data in it. If there is - it starts to traw circles in each point of this array. If flag touchesWereFinished is set - save current context to the UIImage, release pointsArray, set it to nil and reset the flag. There are a lot disadvantages of this method: It is slow It becomes extremely slow when user touches and move finger for long time. Array becomes enormous "Lines" composed by circles are ugly I would like to change my algorithm to make it bit faster and line smoother. In result I would like to have lines like on the picture at following URL (sorry, not enough reputation to insert an image): http://2.bp.blogspot.com/_r5VzEAUYXJ4/SrOYp8tJCPI/AAAAAAAAAMw/ZwDKXiHlhV0/s320/SketchBook+Mobile(4).png Can you advice me, ho I can draw lines this way (smooth and slim on the edges)? I thought to draw circles with alpha gradient on the edges (to make lines smoother), but it will be extremely slowly IMHO. Thanks for help

    Read the article

  • Java Swing custom shapes (2D Graphics)

    - by juFo
    I need to draw custom shapes. Now when a user clicks on several points on the panel I create a shape using a polygon. public void mouseClicked(MouseEvent e) { polygon.addPoint(e.getX(), e.getY()); repaint(); } But I don't know if this is the best way to draw custom shapes. It should be possible to edit a drawn shape: resize change its fill color change the stroke color copy/paste it move a single point of the polygon ... I have seen people creating an own class implementing the Shape class and using a GeneralPath. But again I have no idea if this is a good way. Now I can create my own shape with a polygon (or with a GeneralPath) but I have no clue how to attach all the edit functions to my own shape (the edit functions I mean the resize, move, etc from above). I hope somebody could show me a way to do this or maybe write a little bit of code to demonstrate this. Thanks in advance!!

    Read the article

  • Getting text position while parsing pdf with Quartz 2D

    - by Koteg
    Hi guys, another question regarding pdf parsing... Just read PDF Reference version 1.7 "5.3.1 Text-Positioning Operators" and I am a little bit confused. I wrote some code to get transformation matrix and initial text position. CGPDFOperatorTableSetCallback (table, "MP", &op_MP);//Define marked-content point CGPDFOperatorTableSetCallback (table, "DP", &op_DP);//Define marked-content point with property list CGPDFOperatorTableSetCallback (table, "BMC", &op_BMC);//Begin marked-content sequence CGPDFOperatorTableSetCallback (table, "BDC", &op_BDC);//Begin marked-content sequence with property list CGPDFOperatorTableSetCallback (table, "EMC", &op_EMC);//End marked-content sequence //Text State operators CGPDFOperatorTableSetCallback(table, "Tc", &op_Tc); CGPDFOperatorTableSetCallback(table, "Tw", &op_Tw); CGPDFOperatorTableSetCallback(table, "Tz", &op_Tz); CGPDFOperatorTableSetCallback(table, "TL", &op_TL); CGPDFOperatorTableSetCallback(table, "Tf", &op_Tf); CGPDFOperatorTableSetCallback(table, "Tr", &op_Tr); CGPDFOperatorTableSetCallback(table, "Ts", &op_Ts); //text showing operators CGPDFOperatorTableSetCallback(table, "TJ", &op_TJ); CGPDFOperatorTableSetCallback(table, "Tj", &op_Tj); CGPDFOperatorTableSetCallback(table, "'", &op_apostrof); CGPDFOperatorTableSetCallback(table, "\"", &op_double_apostrof); //text positioning operators CGPDFOperatorTableSetCallback(table, "Td", &op_Td); CGPDFOperatorTableSetCallback(table, "TD", &op_TD); CGPDFOperatorTableSetCallback(table, "Tm", &op_Tm); CGPDFOperatorTableSetCallback(table, "T*", &op_T); //text object operators CGPDFOperatorTableSetCallback(table, "BT", &op_BT);//Begin text object CGPDFOperatorTableSetCallback(table, "ET", &op_ET);//End text object So this is the output after application lunch: 2010-09-02 15:09:23.041 testSearch[8251:207] op_BT begin Integer value: 0 2010-09-02 15:09:23.043 testSearch[8251:207] op_BT end 2010-09-02 15:09:23.043 testSearch[8251:207] op_Tf begin Integer value: 1 2010-09-02 15:09:23.044 testSearch[8251:207] op_Tf end 2010-09-02 15:09:23.044 testSearch[8251:207] op_Tm begin Float value: 557.364197 2010-09-02 15:09:23.045 testSearch[8251:207] op_Tm end 2010-09-02 15:09:23.045 testSearch[8251:207] op_TJ begin 2010-09-02 15:09:23.046 testSearch[8251:207] Array string value [0]: F 2010-09-02 15:09:23.046 testSearch[8251:207] Array integer value [1]: 94985208 2010-09-02 15:09:23.047 testSearch[8251:207] Array string value [2]: r 2010-09-02 15:09:23.047 testSearch[8251:207] Array integer value [3]: 94985208 2010-09-02 15:09:23.048 testSearch[8251:207] Array string value [4]: o 2010-09-02 15:09:23.048 testSearch[8251:207] Array integer value [5]: 94985208 2010-09-02 15:09:23.049 testSearch[8251:207] Array string value [6]: m s 2010-09-02 15:09:23.049 testSearch[8251:207] Array integer value [7]: 94985208 2010-09-02 15:09:23.049 testSearch[8251:207] Array string value [8]: a 2010-09-02 15:09:23.050 testSearch[8251:207] Array integer value [9]: 94985208 2010-09-02 15:09:23.050 testSearch[8251:207] Array string value [10]: m 2010-09-02 15:09:23.051 testSearch[8251:207] Array integer value [11]: 94985208 2010-09-02 15:09:23.051 testSearch[8251:207] Array string value [12]: p 2010-09-02 15:09:23.052 testSearch[8251:207] Array integer value [13]: 94985208 2010-09-02 15:09:23.053 testSearch[8251:207] Array string value [14]: l 2010-09-02 15:09:23.054 testSearch[8251:207] Array integer value [15]: 94985208 2010-09-02 15:09:23.055 testSearch[8251:207] Array string value [16]: e t 2010-09-02 15:09:23.055 testSearch[8251:207] Array integer value [17]: 94985208 2010-09-02 15:09:23.057 testSearch[8251:207] Array string value [18]: o r 2010-09-02 15:09:23.057 testSearch[8251:207] Array integer value [19]: 94985208 2010-09-02 15:09:23.058 testSearch[8251:207] Array string value [20]: e 2010-09-02 15:09:23.058 testSearch[8251:207] Array integer value [21]: 94985208 2010-09-02 15:09:23.059 testSearch[8251:207] Array string value [22]: s 2010-09-02 15:09:23.059 testSearch[8251:207] Array integer value [23]: 94985208 2010-09-02 15:09:23.060 testSearch[8251:207] Array string value [24]: u 2010-09-02 15:09:23.061 testSearch[8251:207] Array integer value [25]: 94985208 2010-09-02 15:09:23.061 testSearch[8251:207] Array string value [26]: l 2010-09-02 15:09:23.062 testSearch[8251:207] Array integer value [27]: 94985208 2010-09-02 15:09:23.062 testSearch[8251:207] Array string value [28]: t 2010-09-02 15:09:23.063 testSearch[8251:207] op_TJ end If someone is familiar with text matrix and text positioning operators it would be nice to explain how all those thing work. How to calculate text position (or glyph?) using Tm (transformation matrix and other data)?

    Read the article

  • Searching a 2D array for a range of values in java

    - by Paige O
    I have a 2^n size int array and I want to check if an element exists that is greater than 0. If the element exists, I want to divide the array by 4 and check if the coordinates of the found element are in the 1st, 2nd, 3rd or 4th quadrant of the array. For example, logically if the element exists in the first quadrant it would look something like this: If array[][] 0 && the row of that coordinate is in the range 0-(grid.length/2-1) && the column of that coordinate is in the range 0-(grid.length/2-1) then do something. I'm really not sure how to check the row and column index of the found element and store those coordinates to use in my if statement. Help!

    Read the article

  • Collision Detection (Ground & Slopes) in 2D Platform Game using Pygame Rects

    - by RedCap
    Hi, First off, I am not after any instructions on logic for collision detection; I get it. What I am trying to work out is the least complicated way to do this with Pygame using Sprites & Rects. I want to be able to check collisions for the Player against ground, walls & slopes. In theory it is quite straight forward, but I'm having difficulty because it seems like you cannot do this with one Rect. One Rect is simple enough to get you collisions in the X plane against walls. The same Rect could be used also be used in the Y plane against solids, but not with slopes - since with the collision routines in Pygame it checks the whole Rect (or mask), rather than perhaps just the bottom middle of the Rect. It seems in addition you need to have a number of "sprites" to check collisions with, that are 1x1 pixel in various places around the Player. What's the easiest way to do this, without having a bunch of 3, 4, or more separate "collision pixels" to check against slopes? Geoff

    Read the article

  • Converting 2D coordinates from multiple viewpoints into 3D coordinates

    - by Kirk Smith
    Here's the situation. I've got a set of 2D coordinates that specify a point on an image. These 2D coordinates relate to an event that happened in a 3D space (video game). I have 5 images with the same event point on it, so I have 5 sets of 2D coordinates for a single 3D coordinate. I've tried everything I can think to translate these 2D coordinates into 3D coordinates, but the math just escapes me. I have a good estimate of the coordinates from which each image was taken, they're not perfect but they're close. I tried simplifying this and opening up Cinema 4D, a 3D modeling application. I placed 5 cameras at the coordinates where the pictures were taken and lined up the pictures with the event points for each one and tried to find a link, but nothing was forthcoming. I know it's a math question, but like I said, I just can't get it. I took physics in high school 6 years ago, but we didn't deal with a whole lot of this sort of thing. Any help will be very much appreciated, I've been thinking on it for quite a while and I just can't come up with anything.

    Read the article

  • BlitzMax - generating 2D neon glowing line effect to png file

    - by zanlok
    Originally asked on StackOverflow, but it became tumbleweed. I'm looking to create a glowing line effect in BlitzMax, something like a Star Wars lightsaber or laserbeam. Doesn't have to be realtime, but just to TImage objects and then maybe saved to PNG for later use in animation. I'm happy to use 3D features, but it will be for use in a 2D game. Since it will be on black/space background, my strategy is to draw a series of white blurred lines with color and high transparency, then eventually central lines less blurred and more white. What I want to draw is actually bezier curved lines. Drawing curved lines is easy enough, but I can't use the technique above to create a good laser/neon effect because it comes out looking very segmented. So, I think it may be better to use a blur effect/shader on what does render well, which is a 1-pixel bezier curve. The problems I've been having are: Applying a shader to just a certain area of the screen where lines are drawn. If there's a way to do draw lines to a texture and then blur that texture and save the png, that would be great to hear about. There's got to be a way to do this, but I just haven't gotten the right elements working together yet. Any help from someone familiar with this stuff would be greatly appreciated. Using just 2D calls could be advantageous, simpler to understand and re-use. It would be very nice to know how to save a PNG that preserves the transparency/alpha stuff. p.s. I've reviewed this post (and many many others on the Blitz site), have samples working, and even developed my own 5x5 frag shaders. But, it's 3D and a scene-wide thing that doesn't seem to convert to 2D or just a certain area very well. I'd rather understand how to apply shading to a 2D scene, especially using the specifics of BlitzMax.

    Read the article

  • How to implement a birds eye view of 2D Grid Map using Android

    - by IM_Adan
    I'm a true beginner with using the android platform and I'm having difficulties on implementing a 2D grid system for a tower defense type game. Where I can place towers on a specific tile and enemies will be able to traverse through tiles etc. What I would like is a practical explanation of how I could tackle this. A step by step guide for dummies. This is what I believe are the necessary steps to take, I think I might be wrong but I hope someone could help me out. Calculate the Width and Height of the view I'm working with. Based on that, determine the number of tiles required and their dimensions, (Still not sure how I would do this) Create each tile as a Rectangle object and draw these rectangle on a canvas I would really be grateful if someone could steer me in the right direction on how to implement a 2D Grid Map using android. I hope the answer to this questions helps the TRUE beginners out there like me. I have looked at the following links below yet I still feel that I don't trully understand what's going on. For XNA: 2D Grid based game - how should I draw grid lines? How to Create a Grid for a 2D Game? Also a quick note: All my previous game development has been in Java, mostly using Java SE and Swing. I also have good understanding of the game development process, it is only android thats confusing me :S

    Read the article

  • Light mask map and camera for static lights in XNA Platformer

    - by JiminyCricket
    Using the example for some basic light maps found here : http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html, I've managed to create a lightmap texture using individual lightmaps and display it over a 2D tiled world as in the Platformer example. I'm using the very basic 2D camera example as found here : http://www.david-amador.com/2009/10/xna-camera-2d-with-zoom-and-rotation/, and the problem is that the lightmap texture scrolls with the player sprite. This looks pretty good and would be excellent for lighting the player sprite as it moves. But, I also want to be able to place static lights (or some initial position for the lights) that do not move with the player or camera. When I turn off the camera or give it a static position, it works as a series of static lights so I believe it's probably caused by the camera transformation matrix following the player around. I'm using RenderTarget2Ds, one for the main game screen after all the backgrounds and tiles are rendered, and one for the "lightmap" which consists of a black background and a bunch of lighting textures which are merged with it using additive blending. For now, I'm doing all of this in PlatformerGame.cs where the camera transformation and position is set and the level.Draw() call is made. I can't figure out how to separate the drawing of the lightmap and the camera following the player. I was thinking it would be better to render the shadows and lighting directly in the drawing of the level itself, but I'm not sure how to do that either because this technique requires RenderTarget2Ds and calling SpriteBatch.Begin()/End().

    Read the article

  • Missing launcher after 12.04 upgrade

    - by Preston Zacharias
    I recently upgraded to ubuntu 12.04 and after doing some updates and such my application launcher and title bars (for window dialogues) are missing. Basically the entire unity GUI is missing! Not sure what happened so I installed gnome 3 and it was missing a launcher too, but did have title bars. In addition the bar found at the top that lets you know what's open and allows gnome extensions to be displayed is not interactive. I can't click, right click, alt + click (right or left), alt + super click (right or left) anywhere! I even installed an application menu from the gnome site and it is not interactive either. However, since there is no way to launch applications i have to use terminal and if i minimize an app it will disappear completely. Then i decided to try unity 2D and it is incredibly messed up. Black background, launcher is there but icons and top bar while on desktop are completely distorted. They're not just pixalated; they're all sorts of funky colors and when i open something from unity 2d launcher it will show it's opened in the launcher but nothing appears on my screen. When trying to view videos on youtube the video is distorted and looks just as unity 2d does. Strange enough: the audio works fine, just not videos. Pictures loads, but not ads that stream video. Any suggestions to get my launcher and the unity GUI back? I tried reinstalling gnome, unity 3d, and unity 2d from terminal. no change. also reinstalled unity desktop and tried resetting it: nothing happened.

    Read the article

  • 2D Tile-Based Concept Art App

    - by ashes999
    I'm making a bunch of 2D games (now and in the near future) that use a 2D, RPG-like interface. I would like to be able to quickly paint tiles down and drop character sprites to create concept art. Sure, I could do it in GIMP or Photoshop. But that would require manually adding each tile, layering on more tiles, cutting and pasting particular character sprites, etc. and I really don't need that level of granularity; I need a quick and fast way to churn out concept art. Is there a tool that I can use for this? Perhaps some sort of 2D tile editor which lets me draw sprites and tiles given that I can provide the graphics files.

    Read the article

  • How to handle animations?

    - by Bane
    I am coding a simple 2D engine to be used with HTML5. I already have classes such as Picture, Scene, Camera and Renderer, but now I need to work on Animations. Picture is basocally a wrapper for a normal image object, with it's own draw method, but this is unrelated, I'm interested in how animation in 2D games is usually done. What I planned to do, is to have the Animation class as well act like a wrapper for a few image objects, and then have methods such as getCurrentImage, next and animate (which would use intervals to quickly change the current image). I meant to feed the animation a couple of PNG's at inicialisation. Is quickly swapping PNG images acceptable for 2D animation? Are there some standard ways of doing this, or are there flaws in my ways?

    Read the article

  • 3D array in a 2D array

    - by Smallbro
    Currently I've been using a 3D array for my tiles in a 2D world but the 3D side comes in when moving down into caves and whatnot. Now this is not memory efficient and I switched over to a 2D array and can now have much larger maps. The only issue I'm having now is that it seems that my tiles cannot occupy the same space as a tile on the same z level. My current structure means that each block has its own z variable. This is what it used to look like: map.blockData[x][y][z] = new Block(); however now it works like this map.blockData[x][y] = new Block(z); I'm not sure why but if I decide to use the same space on say the floor below it wont allow me to. Does anyone have any ideas on how I can add a z-axis to my 2D array? I'm using java but I reckon the concept carries across different languages.

    Read the article

  • Whats the right program for me?

    - by andyphillips20
    I would like to learn C++ so I can get a job in the game industry, but there are so many options it a little confusing. I know most of you will say I should read up on C++ before attempting to program it but I learn best by doing things rather then reading. That being said I don't understand some of the thing suggested on other questions, because I've read a few trying to find whats right for me, so putting things in the simplest terms would be helpful. I've been making a couple of games 2d using gamemaker and if theres a C++ equivalent that would be perfect, but if not possible I would like an IDE that allows me to easily continue making 2d games, and is fairly simple to learn. Having a 2d sprite editor would be a nice plus but I can understand if its not every thing I want in one program

    Read the article

  • Wait for Unity 4.3? [on hold]

    - by RoarG
    We are currently in a pre-production of developing a 2d game in Unity but with the arrival of Unity 4.3 around the corner we were contemplating waiting for the release 4.3 instead of starting on 4.2, mainly since 4.3 got native 2d support. Is this something to be worried about, or do we need to start over to take use of the advantages that 4.3 brings, or does it matter at all? What benefits does one get in Unity 4.3, considering developing a 2d game? and is it a lot of tweaking to rework if we start the project before 4.3 release?

    Read the article

  • Racing MMO for Linux - 2D or 3D - Massively Multiplayer Online Racing Games for Linux

    - by Paulocoghi
    I really like multiplayer racing games, like Need for Speed World or similar. I wonder if there is any MMO racing game for Linux (2D or 3D). Browser-based games are also accepted. Note: I tried this question in the Gaming Q&A of StackExchange (see link below), but one user said that my question was off-topic. http://gaming.stackexchange.com/questions/16329/racing-mmo-for-linux-2d-or-3d-massively-multiplayer-online-racing-games

    Read the article

  • Tower defence game poison tower in fieldrunners dynamics

    - by Syed Ali Haider Abidi
    I had made a 2d tower defence game in unity3d.done all the pathfinder tower upgrading cash stuff.now the dynamics. can one help me in making the dynamics of the paint tower..please remember as its a 2d game so i am working on spritesheets. This tower is more likely poison tower in fieldrunners.fow now i have only one image which follows the enemy but it remains the same but in fieldrunners its more realistic.it changes its direction when the enemies are on different angles.

    Read the article

  • Créer des QR Codes avec Zxing et Java 2D en 5 minutes, par Thierry Leriche-Dessirier

    Bonjour, Je vous propose un article intitulé "Créer des QR Codes avec Zxing et Java 2D, en 5 minutes". Ce petit article s'intéresse à la génération de QR codes en Java. Nous allons voir qu'il est relativement simple de créer une matrice de modules à l'aide de Zxing puis d'en faire une jolie image avec Java 2D. L'article est visible ici : http://thierry-leriche-dessirier.dev...-java2d-5-min/ Et je vous invite aussi à lire mes autres articles ici : http://thierry-leriche-dessirier.dev...#page_articles ...

    Read the article

  • Using XNA for a 2D isometric game, but wanna move on

    - by Daniel Ribeiro
    I've been building a 2D isometric game (with learning purposes) in C# using XNA. I found it's really easy to manage sprite sheets loading, collision, basic physics and such with the XNA api. The thing is, I want to move on. My real goal is to learn C++ and develop a game using that language. What engine/library would you guys recommend for me to keep going on that same 2D isometric game direction using pretty much sprite sheets for the graphical part of the game?

    Read the article

  • Hashing 3D position into 2D position

    - by notabene
    I am doing volumetric raycasting and curently working on depth jitter. I have 3D position on ray and want to sample 2D noise texture to jitter the depth. Function for converting (or hashing) 3D position to 2D have to produce absolutely different numbers for a little changes (especialy because i am sampling in texture space so sample values differs very very little) and have to be "shader-wise" - so forget about branches, cycles etc. I'm looking forward for yours nice and fast solutions.

    Read the article

  • How to change the binding of Meta key which runs the Unity's Dash?

    - by LFC_fan
    Currently, I am using the Unity Qt panel in my Gnome desktop of Ubuntu 10.10, and when I press the Meta a.k.a. Windows key, the Unity's dash launches, and I can't use any compiz based shortcuts. Same behaviour is exhibited when I log in to Unity 2D as well, as the Meta key launches the dash. I have no desire to change my Compiz shortcuts, so is there any way to change the keyboard mapping of Unity 2D's dash to something other or disable this shortcut completely?

    Read the article

  • How to change the binding of Windows key which runs Unity's Dash?

    - by LFC_fan
    Currently, I am using the Unity Qt panel in my Gnome desktop, and when I press the Windows key, the Unity's dash launches, and I can't use any compiz based shortcuts. Same behaviour is exhibited when I log in to Unity 2D as well, as the Windows key launches the dash. I have no desire to change my Compiz shortcuts, so is there any way to change the keyboard mapping of Unity 2D's dash to something other or disable this shortcut completely?

    Read the article

  • Tutoriel OpenGL Moderne : texte 2D, affichez des textes en 2D dans votre application OpenGL 3 et supérieur

    Bonjour à tous,La rubrique 2D/3D/Jeux est heureuse de vous présenter une la suite de la série de tutoriels consacrée à OpenGL moderne (les versions à partir d'OpenGL 3.3). Ces tutoriels vous permettront d'intégrer facilement les nouveaux concepts d'OpenGL afin de profiter au maximum des dernières technologies de vos cartes graphiques. Ce onzième tutoriel vous apprendra à afficher du texte en 2D dans vos applications OpenGL.Bonne lecture.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >