• Create Account

# destructivArts

Member Since 27 Apr 2011
Offline Last Active Aug 09 2013 12:46 PM

### In Topic: Xna 3d coordinates problem

04 December 2012 - 03:54 PM

Changing the order worked but it still is skewed.

My view matrix is:
view = Matrix.CreateLookAt(pos, target, up);
and the Projection matrix is
view = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, (float)Game.Window.ClientBounds.Width / (float)Game.Window.ClientBounds.Height, 1, 100);

Edit:
Ok, well changing the order worked but that wasn't why it was skewed.
I was defining the vertices in an array of VertexPositionColor and I was overwriting the Object at index 1.
ie.
```vert[0] = new VertexPositionColor(variables);
vert[1] = new VertexPositionColor(variables);
vert[1] = new VertexPositionColor(variables);
```

So thank you for your help, worked perfectly

### In Topic: where to go now?

02 September 2012 - 08:23 PM

Here's some ideas: Progression

### In Topic: Java tips

31 August 2012 - 03:49 PM

I took a class exactly like that. I signed up for the class and then over the summer taught myself the curriculum. So when I got to class, I was able to finish the projects the teacher assigned us while she was still teaching the new lesson. (ie. Today we're going to learn how to create a calculator program. To do that we need functions. She teaches, I type.) And while everyone else was working on the project, I was looking up stuff to make games with.

If the class you're in is an AP track course you won't learn a whole lot more than the basics of java.

Books and the internet are your best friends.
I used Learn Java in 21 days (I didn't finish in 21 days, but it's still a good reference), and http://math.hws.edu/javanotes/.
For game related programming tips I read Core Techniques and Algorithms in Game Programming. The code's in C++ but theres more in pseudo code and the C++ code is easy to read.

Hope this helps,
Peter

### In Topic: Updating the Player in a Quad Tree

31 August 2012 - 04:09 AM

Ok, I'll keep that in mind.

One other question:
I've implemented an ObservableInput object that calls this update function every frame:
```    public void updateInput(MouseHandler m, KeyHandler k){
//Mouse
mousePos = m.getMousePos();
//Keyboard
keys = k.getKeyStates();
}
```
For some reason it's not calling the update function for it's observers.

I don't know if this has anything to do with it but I'm setting the Entities as observers when they are placed in a data list of a node. I'm removing them when they have to be shifted, and adding them again when they are placed. I know the ObservableInput object sees them, so I don't know why it's not updating.

Just to be thorough, heres the entity update function.
```public void update(Observable obs, Object obj){
}
```
And the players:
```    @Override
public void update(Observable o, Object obj){
System.out.println("1");
if(o instanceof ObservableInput){
ObservableInput obs = (ObservableInput)o;
buttonState = obs.getButtonState();
mousePos = obs.getMousePos();
keys = obs.getKeyState();
}
}
```

I'll keep looking in the meantime,
Thanks again for all the help!
Peter

### In Topic: Updating the Player in a Quad Tree

31 August 2012 - 02:13 AM

Thank you, I looked up the Observer/Observable, and I won't actually have to change much to implement it.

As to your concern about putting too much into a base class, can't I just create children classes for each kind of entity I need? All I would have to do is put empty functions into the entity class so that its children could use them. (Entity already takes care of animation updates, rendering, and collision detection.)

Thanks again for the help!
Peter

PARTNERS