1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-23 20:59:58 +01:00
This commit is contained in:
Miloslav Číž 2019-06-18 23:17:37 +02:00
parent 81d3264dfd
commit c0487d4066
3 changed files with 18 additions and 17 deletions

View file

@ -3,18 +3,18 @@
#define CAR_VERTEX_COUNT 12
const S3L_Unit carVertices[CAR_VERTEX_COUNT * 3] = {
-159, 27, -121, // 0
-119, 205, -88, // 3
-119, 205, 88, // 6
47, 27, -121, // 9
7, 205, -88, // 12
7, 205, 88, // 15
-152, 116, 159, // 18
40, 116, 159, // 21
-159, 103, 267, // 24
-144, 27, 267, // 27
32, 27, 267, // 30
47, 103, 267 // 33
-103, 13, -216, // 0
-63, 191, -184, // 3
-63, 191, -7, // 6
103, 13, -216, // 9
63, 191, -184, // 12
63, 191, -7, // 15
-96, 102, 63, // 18
96, 102, 63, // 21
-103, 89, 172, // 24
-88, 13, 172, // 27
88, 13, 172, // 30
103, 89, 172 // 33
}; // carVertices
#define CAR_TRIANGLE_COUNT 18

View file

@ -224,10 +224,12 @@ int main()
}
scene.camera.transform.translation.x = scene.models[1].transform.translation.x - carDirection.x;
scene.camera.transform.translation.y = S3L_FRACTIONS_PER_UNIT;
scene.camera.transform.translation.y = S3L_FRACTIONS_PER_UNIT / 2;
scene.camera.transform.translation.z = scene.models[1].transform.translation.z - carDirection.z;
scene.camera.transform.rotation.y = scene.models[1].transform.rotation.y;
S3L_lookAt(scene.models[1].transform.translation,&(scene.camera.transform));
scene.camera.transform.translation.y = S3L_FRACTIONS_PER_UNIT;
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer,textureSDL,NULL,NULL);

View file

@ -72,9 +72,8 @@ features:
bugs:
- Barycentric coodinates can get wrong in these ways:
- Any of them can exceed the range <0,511>
- b0 + b1 can be > 511, which causes b2 (= 511 - b0 - b1) to be negative!
- Long triangle interpolation overflows -- e.g. in the city demo, can be seen
a lot at the blue skyscraper.
repeated: