Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 12 Oct 2002
Offline Last Active Mar 22 2012 04:39 AM

Posts I've Made

In Topic: [XNA] 2D Flashlight Vision

10 June 2011 - 06:48 AM

Does this tutorial help?

Do I actually need something this complicated? I don't necessarily need to cast light in all directions, just at a specific angle of view. heck, I don't even need to cast shadows, only a light overlay.

I should also specify that I'm trying to target WP7, which I think has problems with custom shaders.

In Topic: XNA Small Solid Texture2D

09 May 2008 - 11:51 PM

It seems to be TextureUsage now, but yeah. Thank you that did the trick. :D

In Topic: 2d and 3d puzzle solvers

16 November 2007 - 11:59 AM

I'm a little stumped right now, I'm having troubles figuring out how to locate a piece on the cube. Since I'm storing everything as a bunch of 2d arrays, They don't have any real relation to what pieces are connected.


So I need a lookup function, a way to identify a piece I'm looking for. Say I want to find the Red and White side cubie, I need a function to spit out faces 41 and 10 and have it tell me where they are located in my data array.

//How my cube is stored
int data[3][3][6];
for (z=0;z<6;z++) for (y=0;y<3;y++) for (x=0;x<3;x++)
data[x][y][z] = i++;

//How my colors are formed
int color = int(value/9);

//How the Z dimensions are laid out.
//_ 4
//0 1 2 3
//_ 5

Once I can locate these cubies I can begin to move these little guys around to where they belong. Anyway, I'll keep trying. I think I might start by numbering all the cubies.

In Topic: 2d and 3d puzzle solvers

15 November 2007 - 01:54 PM

Thanks everyone, It's going to be a bit of work for me to understand everything here. I'll take my time to try to figure it all out.

I decided to go with Rockoon1's suggestion and go with 6 arrays for the cube.

My test bed is in command line c++. It took me a while to write out all the transformations, but I think I figured it all out.

Here is what I got so far.
cube_test_01 2d test, with my cube display. Most of my transformations use a 2d rotation somewhere.
cube_test_02 Rotate face.
cube_test_03 Rotate top row.
cube_test_05 Rotate right column up with different display.
cube_test_06 Same as the last one, normal display.
cube_test_07 Grid, from rotating the middle slice on each axis.

I got the rotations currently in 3 functions.
rotateFaceClockwise(int slice)
rotateTopRowLeft(int slice)
rotateRightColUp(int slice)
I just tell it which of the 3 slices I want when I turn. Currently these rotations only work in one direction, so If I want to rotate right instead of left, I gotta use the turn left three times method. XD For now it gets the job done.

Now I just got the hard part of telling it how to solve.

In Topic: Getting Last Object inserted in STL Container

14 July 2005 - 12:47 AM

Um, Ok, using a pointer to the end() iterator works fine for containers where objects are only added to the end, like i'll be doing for Vector and in my case for a List.

But can you go back over a Map? It's a sorted container, so the end could not be the last. (then again, like I said in my first post, I suppose I could just save the key when I add, since it's unique).

Thanks for the help btw... I think most of my troubles are due to lack of sleep. I'm going to bed now. ^^;