Register - Login
Views: 99832538
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 09:42:17 PM
Jul - Posts by spinout
spinout
Random nobody
Level: 6


Posts: 1/4
EXP: 533
For next: 374

Since: 02-28-10


Since last post: 12.2 years
Last activity: 11.9 years

Posted on 02-28-10 08:40:39 AM, in SM64 Fast3D to Zelda F3DEX2 Converter (last edited by spinout at 02-28-10 05:41 AM) Link
http://spinout.byethost6.com/sm64toz64src.tar.gz
spinout
Random nobody
Level: 6


Posts: 2/4
EXP: 533
For next: 374

Since: 02-28-10


Since last post: 12.2 years
Last activity: 11.9 years

Posted on 03-02-10 12:55:53 AM, in Mario 64 Level Importer (last edited by spinout at 03-07-10 06:40 AM) Link
Here's some pseudo-code to convert faces of more than one point to triangles so you can do quads and stuff:




for (i=0;i<PointListLen-2;i++,TriCount++) {
TriList[TriCount].Vert[0] = PointList[0];
TriList[TriCount].Vert[1] = PointList[i+1];
TriList[TriCount].Vert[2] = PointList[i+2];
}


PointList = Array of points in face
PointListLen = Amount of points in face
TriList = Array of faces
TriCount = Number of triangles in TriList

I hope this helps!
spinout
Random nobody
Level: 6


Posts: 3/4
EXP: 533
For next: 374

Since: 02-28-10


Since last post: 12.2 years
Last activity: 11.9 years

Posted on 03-02-10 11:26:34 PM, in Mario 64 Level Importer (last edited by spinout at 03-07-10 06:40 AM) Link
Originally posted by BigBrain
Originally posted by messiaen
Originally posted by spinout



for (i=0;i<PointListLen-2;i++,TriCount++) {
TriList[TriCount].Vert[0] = PointList[0];
TriList[TriCount].Vert[1] = PointList[i+1];
TriList[TriCount].Vert[2] = PointList[i+2];
}


I hope this helps!


Seems simple, I can probably flexibilize my parsing code by using strtok() to find the number of faces in polygon. Thanks!


I'd advise you against using this code for other polyons than tris and quads, since it might produce strange effects when using higher order polygons than quads (if the polygon isn't concave* for example). These effects would be a pain to properly recognize and "debug", so you should probably fail (not just warn or be quiet) if someone tries to import an obj file containing faces with more than 4 edges (not sure whether you're doing that already).
But for triangles and quads this code works just fine of course, yeah.

* I think the problems even only arise if the polygon _is_ concave. For convex faces you might still try to apply the algorithm, but that'd bloat the "validity" check on the other hand, so you might be best off just disabling support for anything greater than quads.

I'm pretty sure it works for any amount of points within a .obj "f" polygon.
spinout
Random nobody
Level: 6


Posts: 4/4
EXP: 533
For next: 374

Since: 02-28-10


Since last post: 12.2 years
Last activity: 11.9 years

Posted on 03-09-10 11:29:15 PM, in Mario 64 Level Importer Link
Originally posted by wwwarea
I was using collision type 13, A, and 23. Thats all I could remember. So I type them like collisionType 23 but it diddn't work like the lava. Yeah, I used the list, when you said decimal, what did you mean like that? Like can you please tell me how I should type 0013 for very slippery hill if I wasn't typing it right?

hexadecimal	: decimal

0xA : 10
0x13 : 19
0x23 : 35
Jul - Posts by spinout


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

21 database queries, 7 query cache hits.
Query execution time: 0.075539 seconds
Script execution time: 0.006375 seconds
Total render time: 0.081914 seconds