Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Banbeano

Pages: [1]
1
Graphics / Re: Vector Array and Transforms
« on: August 12, 2013, 01:14:44 am »
Well the complexity was the general problem for me too. Believe me it really doesn't get much simpler than this. There is a lack of useful information on how vectorarray is used and even less on the .net binds, the forums were kind of my last hope. I appreciate what help you could give, an I'm sorry to have messed up my post as badly as I did.


2
Graphics / Re: Vector Array and Transforms
« on: August 11, 2013, 06:55:59 am »
Thank you for the example that was very helpful. I was able to select the point, but I still haven't got it to actually transform anything. The points just snap over to the top left (0,0) and don't do much. I'm guessing it has something to do with not setting the origin, which I have no idea how to do with a vertex array.

Code: [Select]
if (entityList[i] == name)
{
    tempVertex = vertexArray[(uint)i * 4];
    transform.Rotate(degrees, vertexArray[(uint)i * 4].Position);
    tempVertex.Position = transform.TransformPoint(tempVertex.Position);
    vertexArray[(uint)i * 4] = tempVertex;
                   
    tempVertex = vertexArray[(uint)i * 4 + 1];
    transform.Rotate(degrees, vertexArray[(uint)i * 4].Position);
    tempVertex.Position = transform.TransformPoint(tempVertex.Position);
    vertexArray[(uint)i * 4 + 1] = tempVertex;

    tempVertex = vertexArray[(uint)i * 4 + 2];
    transform.Rotate(degrees, vertexArray[(uint)i * 4].Position);
    tempVertex.Position = transform.TransformPoint(tempVertex.Position);
    vertexArray[(uint)i * 4 + 2] = tempVertex;

    tempVertex = vertexArray[(uint)i * 4 + 3];
    transform.Rotate(degrees, vertexArray[(uint)i * 4].Position);
    tempVertex.Position = transform.TransformPoint(tempVertex.Position);
    vertexArray[(uint)i * 4 + 3] = tempVertex;
}

What am I missing here?

3
Graphics / Re: Vector Array and Transforms
« on: August 10, 2013, 01:54:27 am »
Whoops, sorry that was supposed to be:

Code: [Select]
if (entityList[i] == name)
{
     transform = state.Transform;
     transform.TransformPoint(vertexArray[(uint)i * 4].Position);
     transform.TransformPoint(vertexArray[(uint)i * 4 + 1].Position);
     transform.TransformPoint(vertexArray[(uint)i * 4 + 2].Position);
     transform.TransformPoint(vertexArray[(uint)i * 4 + 3].Position);
     transform.Rotate(degrees);
     state.Transform = transform;
}

Stupid typo.

Thank you Laurent for your help, but I'm still rather confused on how you would use it to select the vertexes. I'm still playing around with it to get it to work, but an example of use would be extremely helpful.

4
Graphics / Re: Vector Array and Transforms
« on: August 09, 2013, 02:54:47 am »
Could I get and example of use? I already tried to use PrasnformPoint for this and I couldn't get it to work.

What I came up with was:

               
Code: [Select]
if (entityList[i] == name)
                {
                    transform = state.Transform;
                    transform.TransformPoint(vertexArray[(uint)i * 4].Position);
                    transform.TransformPoint(vertexArray[(uint)i * 4 + 1].Position);
                    transform.TransformPoint(vertexArray[(uint)i * 4 + 2].Position);
                    transform.TransformPoint(vertexArray[(uint)i * 4 + 3].Position);
                    state.Transform.Rotate(degrees);
                    state.Transform = transform;
                }

Am I even on the right track here?

5
Graphics / Vector Array and Transforms
« on: August 08, 2013, 06:22:53 pm »
In my current project I have been trying to unify my draw calls down to as few as possible. I took all the shapes and spites that I was using and added them to a Vertex Array. Seemed simple enough at the time, so I wrote the entire draw manager class to accommodate that design. Everything went quite smooth, until I started implementing rotate and scale functions. I can't seem to figure out a way to transform only the parts of the Vertex Array that need to be rotated or scaled without transforming everything within the Vertex Array. What I would like to do is to transform individual shapes in the Vertex Array so they can act separately but still be drawn in one draw command.
I looked around on the internet for an answer, came up empty, and the documentation on the .net version of SFML is kind of spotty. I'm really stumped on this one, and it's really starting to bug me.
Any help or pointers would be appreciated.

Pages: [1]
anything