The camera stays at the same position, and the arguments passed to the triangle drawing routine are always the same, so I wonder why it draws it correctly the first time, and only draws a part of it the other times.
BTW: by filling the graphic buffer every frame, I noticed that the rest of the triangle is drawn white, but it is still drawn.
I have GTA vice city, GTA san andreas, and GTA 4, but i only play GTA4, becouse vice city and san andreas aren't installed on this computer, and i lost the CD's.
I also have Red dead rendemtion, an other game in the GTA style, also made by rockstar games.
Maybe it does help. If i know how it should be done, then i might be able to rewrite it in asm. And i need a good sorting algorithm for when i'm going to add z-ordering to the engine.
EDIT: I just found a mistake in my code, and now, the triangle is fully drawn, but still just solid black.
EDIT2: I just noticed an other mistake in the source, which made texture mapping impossible. This was not the full cause of the texture not being mapped, however, ass the routine is still drawing a solid black triangle.
EDIT3: Finally!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
the third mistake was caused by a very stupid mistake: I have a text file in the project folder named 'Routines.txt', in which all names of all routines in my app are written, with the arguments and the registers that they destroy. A while ago, i replaced the fixed-point multiplication routine, which had other arguments, so this problem was caused by an outdated routines file
EDIT4: it now draws only 1.29 triangles every second, but I'm optimizing it right now. The first thing I'll do is replace the fixed-point math for every pixel with a much simpler one, which only has to be calculated for each horizontal line. The rest of the line can then be calculated with a simple add command. An other optimization I'll try to add is calling getPixel only once for every scan line, instead of every pixel, then using a right rotation to get the mask.
did that basic to assembly source conversion thing work at all?
nope, I haven't found any program that actually converts anything, so I've ported it manually, but i must have made a mistake, ass this is clearly not doing what it should do.
BTW: this routine draws the triangle from top to bottom, which means that the points needs to be in the right order, so does anybody knows a routine to sort the points based on their Y coordinate?
It's a great tool. I already used it a few times when i posted asm source code.
BTW: those terms and conditions, I don't really know how you can agree with them :p And nobody has said anything abouth this. I think nobody here checks them.
I've got goo news and bad news: the good news: I've got affine texture mapping to work on a computer. The bad news: I can't get it to work on a calc. what am I doing wrong?
Computer
Calculator
Everything works just the way it's supposed to.
In the first step (TriangleDrawLoop1), it just draws black pixels, and in the secound draw loop, nothing is drawn.
Memory is indeed a problem: for example: after 2:20 in the video: "Elephant contains 530 906 polygons": A model usually contains almost the same amount of vertices than ploygons, and each vertix contains an int (to store the id of the vertex) and 3 floats(to save it's position). Ints and floats are each 4 bytes, so to store each point, you need 4*4=16 bytes. With polygons, they almost always mean triangles, and for each triangle, you need to store it's id and the points it's made of. So each triangle is stored as 16 bytes. this means that the elephant is approximately (530 906 * 4)*2 = 4 247 248 bytes = 4147kb = 4mb. So only one model of the scene is already 4 megabytes, and this is witout the texture. for that, you'll need another megabyte, so witouth the texture image itself, it's a bit over 5 mb large. And this isn't the only model in the scene.
this can be real, but it's almost impossible to make a game which can fit on any portable storage device with a realistic world in such high detail. You'll need very powerful compression techniques to put what's seen in the video on a DVD. It's possible, but until we can easly store large amounts of data on a computer, it's very unpractical.