Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!

Kyle Brechin

Member Since 16 Jan 2011
Offline Last Active Jun 09 2015 08:44 PM

Posts I've Made

In Topic: How to make multiple rectangles?

28 January 2011 - 01:29 PM

Hmm, that's pretty much the code i ended up with after I made the changes. I think I may have forgotten to update the vertex or index buffer though. Maybe that's why it wasn't showing up right.

In Topic: How to make multiple rectangles?

28 January 2011 - 11:25 AM

I agree completely with your method.

But back to the original point of my post. Understanding how to create another rectangle manually and building up understanding of shown topics thusfar.

Pretend your book stops at the last page where we get the rectangle drawn. Using the same coding style of the book, manually drawing vertices, how would I take the code i wrote about an have it properly draw 2 more rectangles along the border of the original.

In Topic: How to make multiple rectangles?

28 January 2011 - 10:21 AM

So I have to make the triangles separately just like the book does a few pages after with the DrawRectangle() and apply the transformations to their world matrices? I can't just create all the points and draw them?

(by the way, what's the tag for code?! Haha)

In Topic: How to make multiple rectangles?

28 January 2011 - 08:36 AM

With such a small project i didn't bother creating new methods for my two new triangles, but creating new methods for various calls is important especially in the OOP realm. Breaking down methods such as gamepad, keyboard, and graphics initialization, really make the process easier and more reusable.

I got off work and tried running the code, while it ran and compiled (after a few typos i had to fix mainly all my Vertex3 to Vector3 [damn iPhone autocorrect]) I still didn't get the result I wanted. In fact I got something strange. The right rectangle appeared to draw, but t wasn't a rectangle. So I reread the chapter trying to figure where I went wrong.

Then I modified the number of vertices I placed in InitializeVertices() to create only vertices that wouldn't be double (though im sure index buffer helps with this as well). Still didn't get the result I wanted of my little U shaped rectangles facing me.

Any suggestions or pointers in the right direction?

When i get off work again I'll have to give it another go! Ooooo this is fun! :)

In Topic: A small trick not mentioned by the book

27 January 2011 - 01:20 PM

That makes sense, I'll have to toy around with it and see what does what. Like Ohforf said, it's essentially texture wrapping.