Revisit 10 - Rotation

Web log of development issues.

Revisit 10 - Rotation

Postby adamsderk » Wed Jul 22, 2009 4:30 pm

Greetings,

As I have said before, I tend to work on a couple fronts in the game at a time; it gives me time to figure out a problem that stumps me while still making progress.

So as I repetitively bang my head against the rendering engine (I'm having to learn openGL to alter the rendering pipeline to get a damage texture to render), I have also been moving the building code to the bridges.

Ack... well it worked fine until I tried to rotate the bridge and it just disappeared. Well, not exactly, it was still there and I could run into it, it just didn't render. Great, the last thing I needed, but bridges are rarely in alignment with the grid, so I have to fix it (and buildings need to be rotated too).

What turned out to be a red herring was that the object has a "position" and "rotation" in the datablock, which is where I was putting the data in. Well, it turns out that although that is used to "position" the object on creation, rotations are not applied when created, they have to be applied after it is created. So I "doubled-up" and created the bridge in the place I wanted (although I could actually put it anywhere), and then "moved" it to the same position and rotation and voila, it rotates.

So, now I have bridges that can be rotated into position that are actually buildings, so you can walk on them, or come up through them and damage them.

Thanks.
Image
adamsderk
Site Admin
 
Posts: 1404
Joined: Tue Apr 19, 2005 11:52 pm
Location: Western Washington

Postby adamsderk » Fri Jul 24, 2009 4:28 pm

Argh,

Just when you think you have it... the span bridge I have as my test bridge has a box that surrounds the roadway, i.e. it is wide, long, but very shallow, not even a meter thick. And there is no trigger when a unit enters it from the bottom or side. It looks like there is a problem in how the intersection is calculated. I suppose it isn't too surprising since I'm using a trigger which is supposed to be a big rectangular solid. When you use something not they way it is intended, you get results that weren't planned for. So, another bug to fix, but it will probably be a good thing since there was a little issue about being completely inside a building and not colliding with anything.

To code...

Thanks.
Image
adamsderk
Site Admin
 
Posts: 1404
Joined: Tue Apr 19, 2005 11:52 pm
Location: Western Washington


Return to Development Blog

Who is online

Users browsing this forum: No registered users and 1 guest

cron