2d

How can 2D text be reflected onto 3D mesh surface ?

Hi All, How can a 2D text be reflected onto 3D mesh surface in C# ? Thanks in advance. Cemo ...

How to have a local position and global position in a game.

I have a base class called Component. I also have 2 interfaces I2DComponent, and I3DComponent. I am currently working on the I2DComponent. The implementation: /// <summary> /// Represtions a 2D object. These objects will be drawn after 3D objects, /// and will have modifiers automatically provided in the editor. /// </summary> public ...

Allocate 2D Array on Device Memory in CUDA

How do I allocate and transfer(to and from Host) 2D arrays in device memory in Cuda? ...

How to change a 2d array from dynamic to static of a specific size?

I currently have the dynamic array: char *myData[500][10]; //myData is the name of an array of[500][10] pointers to type char. I would like to create a static 2d array, 500 rows X 10 columns, each element storing memory for 40 characters. Would below be the correct way of declaring that? char myData[500][10][40]; ...

iPhone development using sprites

I want to create an iPhone/iPod game. I want it to be 3d, but I want to use sprites instead of OpenGL to do this (I assume this would be easier since I don't know OpenGL). I was thinking of simply layering sprites over top of each other and changing their size to give an illusion of 3d. It doesn't need to be too convincing since the gam...

Pathfinding 2d java game further issues...

Hi all. I asked a question some time ago on java 2d pathfinding... http://stackoverflow.com/questions/735523/pathfinding-2d-java-game The game im developing is based on the idea of theme hospital. The chosen answer from my question, A* pathfinding, the link was awesome, and very helpful. I'm eventually getting to implement this into my ...

2D motion blur solutions

I'm thinking of chucking motion blur into my 2D program, but I doubt the results of my current algorithm. My approach looks like this at the moment: Draw to backbuffer. When time to update front buffer, blend the backbuffer onto the front buffer. Repeat What would cause the "motion blur" effect is obviously the blending, as objects...

Clip or Mask a 2D texture

Hey i was wondering if anyone knows to do clipping with 2D textures for a gui or menu like system. Heres an example output i would like to produce Have a game screen with a size of 500 x 500. With a screen behind it with a size of 1000 x 1000. When i draw a Texture at 0, 0 with the parent screen of 500 x 500 i would like the component...

2D vector projection in Python

The code below projects the blue vector, AC, onto the red vector, AB, the resulting projected vector, AD, is drawn as purple. This is intended as my own implementation of this Wolfram demonstration. Something is wrong however and I can really figure out what. Should be either that the projection formula itself is wrong or that I mistake...

Printing all spreadsheet names only in a workbook.

Is it possible to print ONLY the spreadsheets names (the names at the bottom on the tabs)? I have a workbook with quite a lot of spreasheets (over 500, er, it's a catalogue of music... CDs, what's on them, composors, conductors, movements, times etc.) and would like to do a print out of just the names of, not all and every part of the wo...

Java 2D Image resize ignoring bicubic/bilinear interpolation rendering hints (OS X + linux)

I'm trying to create thumbnails for uploaded images in a JRuby/Rails app using the Image Voodoo plugin - the problem is the resized thumbnails look like... ass. It seems that the code to generate the thumbnails is absolutely doing everything correctly to set the interpolation rendering hint to "bicubic", but it isn't honoring them on ou...

Motion planning without a graph across an infinite plane

An object is positioned at A and wants to move to B. I want to calculate a movement vector there that doesn't move within the distance D of the to-be-avoided points in array C. So if the move vector (B-A) normalized and multiplied with the objects speed would bring it within D of any point in C the vector is rotated so that it doesn't. ...

Matrix from Python to MATLAB

I'm working with Python and MATLAB right now and I have a 2D array in Python that I need to write to a file and then be able to read it into MATLAB as a matrix. Any ideas on how to do this? Thanks! ...

Positioning elements in 2D space with OpenGL ES

In my spare time I like to play around with game development on the iPhone with OpenGL ES. I'm throwing together a small 2D side-scroller demo for fun, and I'm relatively new to OpenGL, and I wanted to get some more experienced developers' input on this. So here is my question: does it make sense to specify the vertices of each 2D eleme...

OpenGL quad rendering optimization

I'm drawing quads in openGL. My question is, is there any additional performance gain from this: // Method #1 glBegin(GL_QUADS); // Define vertices for 10 quads glEnd(); ... over doing this for each of the 10 quads: // Method #2 glBegin(GL_QUADS); // Define vertices for first quad glEnd(); glBegin(GL_QUADS); // Define vertices for...

How to tell if a line intersects a polygon in C#?

Hi! I have a question very similar to this: http://stackoverflow.com/questions/30080/how-to-know-if-a-line-intersects-a-plane-in-c-basic-2d-geometry I am searching for a method that tells if a line is intersecting an arbitrary polygon in C#. I think the algorithm from chris-marasti-georg was very helpful but missing the most important...

Planning a 2D tile engine - Performance concerns

As the title says, I'm fleshing out a design for a 2D platformer engine. It's still in the design stage, but I'm worried that I'll be running into issues with the renderer, and I want to avoid them if they will be a concern. I'm using SDL for my base library, and the game will be set up to use a single large array of Uint16 to hold the...

2D geometry: how to check if a point is inside an angle

hello, i have the following geometrical issue in 2D: i have a point from which i cast an infinite angle (2D-cone) which is given by a direction and an angle. (the point and the direction form a vector and to each side half of the angle forms the 2D-cone) now i want to check if another point in 2D is inside this cone or outside. how c...

Perpendicular line in lat/long

Hi! I am trying to implement the equations presented here regarding finding a point on a given perpendicular distance from a line. Unfortunately the lines I receive are not straight. Is this due to me mixing Lat/long with regular x/y coordinates or have I done something else wrong?! double distPoint = 0.02; doub...

How to calculate a grid based on 4 curved edges?

How can I calculate the points on a 2D grid where the the edges are 4 curved beziers? (see picture): ...