Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[models] Window hangs when loading certain obj files #2219

Closed
NickyBoy89 opened this issue Dec 17, 2021 · 4 comments
Closed

[models] Window hangs when loading certain obj files #2219

NickyBoy89 opened this issue Dec 17, 2021 · 4 comments

Comments

@NickyBoy89
Copy link

Please, before submitting a new issue verify and check:

  • [:heavy_check_mark:] I tested it on latest raylib version from master branch
  • [:heavy_check_mark:] I checked there is no similar issue already reported
  • [:heavy_check_mark:] My code has no errors or misuse of raylib

Issue description

On loading an obj file generated by leocad, when importing the object, instead of showing the model, the window hangs, and after a few seconds, my OS prompts me to force kill the process or wait

It appears this is an issue due to the high number of newmtl declarations in my mtl file, as any number greater than 9 will reproduce this hang in my testing

I traced down the issue to an endless loop in tinyobj_loader_c.h, which from what I understood, tries to repeatedly expand the size of the hash table until it can successfully add a value in. However, the function hash_table_maybe_grow will not expand the size of the table because of the hash table still having some space left

And the function hash_table_insert always returns a failure because the loop in hash_table_insert_value always goes over the list and does not find a match, making the function repeatedly re-try to insert the value without anything changing

Environment

OS: Ubuntu 21.04

INFO: GL: OpenGL device information:
INFO: > Vendor: Intel
INFO: > Renderer: Mesa Intel(R) HD Graphics 620 (KBL GT2)
INFO: > Version: 4.6 (Core Profile) Mesa 21.2.2
INFO: > GLSL: 4.60

Test Files

OBJ file
# Model exported from LeoCAD
#

mtllib test.mtl

v 6.00 6.00 20.00
v -6.00 6.00 20.00
v -6.00 -6.00 20.00
v 6.00 -6.00 20.00
v 6.00 6.00 0.00
v -6.00 6.00 0.00
v -6.00 -6.00 0.00
v 6.00 -6.00 0.00
v -6.00 6.00 20.00
v 6.00 6.00 20.00
v -6.00 -6.00 20.00
v -6.00 6.00 0.00
v -6.00 6.00 20.00
v 6.00 -6.00 20.00
v -6.00 -6.00 0.00
v -6.00 -6.00 20.00
v 6.00 6.00 20.00
v 6.00 6.00 0.00
v 6.00 -6.00 0.00
v 6.00 -6.00 20.00
v 10.00 10.00 0.00
v 6.00 6.00 0.00
v -6.00 6.00 0.00
v -10.00 10.00 0.00
v -6.00 -6.00 0.00
v -10.00 -10.00 0.00
v 6.00 -6.00 0.00
v 10.00 -10.00 0.00
v 10.00 10.00 24.00
v -10.00 10.00 24.00
v -10.00 -10.00 24.00
v 10.00 -10.00 24.00
v 10.00 10.00 0.00
v -10.00 10.00 0.00
v -10.00 -10.00 0.00
v 10.00 -10.00 0.00
v -10.00 10.00 24.00
v 10.00 10.00 24.00
v -10.00 -10.00 24.00
v -10.00 10.00 0.00
v -10.00 10.00 24.00
v 10.00 -10.00 24.00
v -10.00 -10.00 0.00
v -10.00 -10.00 24.00
v 10.00 10.00 24.00
v 10.00 10.00 0.00
v 10.00 -10.00 0.00
v 10.00 -10.00 24.00
v 6.00 0.00 24.00
v 5.54 2.30 24.00
v 4.24 4.24 24.00
v 2.30 5.54 24.00
v 0.00 6.00 24.00
v -2.30 5.54 24.00
v -4.24 4.24 24.00
v -5.54 2.30 24.00
v -6.00 0.00 24.00
v -5.54 -2.30 24.00
v -4.24 -4.24 24.00
v -2.30 -5.54 24.00
v 0.00 -6.00 24.00
v 2.30 -5.54 24.00
v 4.24 -4.24 24.00
v 5.54 -2.30 24.00
v 6.00 0.00 28.00
v 5.54 2.30 28.00
v 4.24 4.24 28.00
v 2.30 5.54 28.00
v 0.00 6.00 28.00
v -2.30 5.54 28.00
v -4.24 4.24 28.00
v -5.54 2.30 28.00
v -6.00 0.00 28.00
v -5.54 -2.30 28.00
v -4.24 -4.24 28.00
v -2.30 -5.54 28.00
v 0.00 -6.00 28.00
v 2.30 -5.54 28.00
v 4.24 -4.24 28.00
v 5.54 -2.30 28.00
v 0.00 0.00 28.00
v 6.00 0.00 28.00
v 5.54 2.30 28.00
v 4.24 4.24 28.00
v 2.30 5.54 28.00
v 0.00 6.00 28.00
v -2.30 5.54 28.00
v -4.24 4.24 28.00
v -5.54 2.30 28.00
v -6.00 0.00 28.00
v -5.54 -2.30 28.00
v -4.24 -4.24 28.00
v -2.30 -5.54 28.00
v 0.00 -6.00 28.00
v 2.30 -5.54 28.00
v 4.24 -4.24 28.00
v 5.54 -2.30 28.00
#

vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 -1.00 0.00
vn 0.00 -1.00 0.00
vn 1.00 0.00 0.00
vn 0.00 1.00 0.00
vn 0.00 -1.00 0.00
vn 0.00 -1.00 0.00
vn 1.00 0.00 0.00
vn 1.00 0.00 0.00
vn 1.00 0.00 0.00
vn 0.00 1.00 0.00
vn 0.00 1.00 0.00
vn 0.00 1.00 0.00
vn -1.00 0.00 0.00
vn -1.00 0.00 0.00
vn -1.00 0.00 0.00
vn -1.00 0.00 0.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 -1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 1.00 0.00
vn 0.00 1.00 0.00
vn -1.00 0.00 0.00
vn 0.00 -1.00 0.00
vn 0.00 1.00 0.00
vn 0.00 1.00 0.00
vn -1.00 0.00 0.00
vn -1.00 0.00 0.00
vn -1.00 0.00 0.00
vn 0.00 -1.00 0.00
vn 0.00 -1.00 0.00
vn 0.00 -1.00 0.00
vn 1.00 0.00 0.00
vn 1.00 0.00 0.00
vn 1.00 0.00 0.00
vn 1.00 0.00 0.00
vn 1.00 0.00 0.00
vn 0.92 0.38 0.00
vn 0.70 0.70 0.00
vn 0.38 0.92 0.00
vn 0.00 1.00 0.00
vn -0.38 0.92 0.00
vn -0.70 0.70 0.00
vn -0.92 0.38 0.00
vn -1.00 0.00 0.00
vn -0.92 -0.38 0.00
vn -0.70 -0.70 0.00
vn -0.38 -0.92 0.00
vn 0.00 -1.00 0.00
vn 0.38 -0.92 0.00
vn 0.70 -0.70 0.00
vn 0.92 -0.38 0.00
vn 1.00 0.00 0.00
vn 0.92 0.38 0.00
vn 0.70 0.70 0.00
vn 0.38 0.92 0.00
vn 0.00 1.00 0.00
vn -0.38 0.92 0.00
vn -0.70 0.70 0.00
vn -0.92 0.38 0.00
vn -1.00 0.00 0.00
vn -0.92 -0.38 0.00
vn -0.70 -0.70 0.00
vn -0.38 -0.92 0.00
vn 0.00 -1.00 0.00
vn 0.38 -0.92 0.00
vn 0.70 -0.70 0.00
vn 0.92 -0.38 0.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
vn 0.00 0.00 1.00
#

g Piece000
usemtl Red
f 4//4 3//3 2//2
f 2//2 1//1 4//4
f 5//5 10//10 9//9
f 9//9 6//6 5//5
f 12//12 13//13 11//11
f 11//11 7//7 12//12
f 15//15 16//16 14//14
f 14//14 8//8 15//15
f 19//19 20//20 17//17
f 17//17 18//18 19//19
f 23//23 24//24 21//21
f 21//21 22//22 23//23
f 25//25 26//26 24//24
f 24//24 23//23 25//25
f 27//27 28//28 26//26
f 26//26 25//25 27//27
f 22//22 21//21 28//28
f 28//28 27//27 22//22
f 30//30 31//31 32//32
f 32//32 29//29 30//30
f 37//37 38//38 33//33
f 33//33 34//34 37//37
f 39//39 41//41 40//40
f 40//40 35//35 39//39
f 42//42 44//44 43//43
f 43//43 36//36 42//42
f 45//45 48//48 47//47
f 47//47 46//46 45//45
f 65//65 49//49 50//50
f 50//50 66//66 65//65
f 66//66 50//50 51//51
f 51//51 67//67 66//66
f 67//67 51//51 52//52
f 52//52 68//68 67//67
f 68//68 52//52 53//53
f 53//53 69//69 68//68
f 69//69 53//53 54//54
f 54//54 70//70 69//69
f 70//70 54//54 55//55
f 55//55 71//71 70//70
f 71//71 55//55 56//56
f 56//56 72//72 71//71
f 72//72 56//56 57//57
f 57//57 73//73 72//72
f 73//73 57//57 58//58
f 58//58 74//74 73//73
f 74//74 58//58 59//59
f 59//59 75//75 74//74
f 75//75 59//59 60//60
f 60//60 76//76 75//75
f 76//76 60//60 61//61
f 61//61 77//77 76//76
f 77//77 61//61 62//62
f 62//62 78//78 77//77
f 78//78 62//62 63//63
f 63//63 79//79 78//78
f 79//79 63//63 64//64
f 64//64 80//80 79//79
f 80//80 64//64 49//49
f 49//49 65//65 80//80
f 81//81 82//82 83//83
f 81//81 83//83 84//84
f 81//81 84//84 85//85
f 81//81 85//85 86//86
f 81//81 86//86 87//87
f 81//81 87//87 88//88
f 81//81 88//88 89//89
f 81//81 89//89 90//90
f 81//81 90//90 91//91
f 81//81 91//91 92//92
f 81//81 92//92 93//93
f 81//81 93//93 94//94
f 81//81 94//94 95//95
f 81//81 95//95 96//96
f 81//81 96//96 97//97
f 81//81 97//97 82//82


MTL file
# Colors used by LeoCAD

newmtl Black
Kd 0.11 0.16 0.20

newmtl Blue
Kd 0.12 0.35 0.66

newmtl Green
Kd 0.00 0.52 0.17

newmtl Dark_Turquoise
Kd 0.02 0.62 0.62

newmtl Red
Kd 0.71 0.00 0.00

newmtl Dark_Pink
Kd 0.83 0.21 0.62

newmtl Brown
Kd 0.33 0.20 0.14

newmtl Light_Grey
Kd 0.54 0.57 0.55

newmtl Dark_Grey
Kd 0.33 0.35 0.33

newmtl Light_Blue
Kd 0.59 0.80 0.85

newmtl Bright_Green
Kd 0.35 0.67 0.25

newmtl Light_Turquoise
Kd 0.00 0.67 0.64

newmtl Salmon
Kd 0.94 0.43 0.38

newmtl Pink
Kd 0.96 0.66 0.73

newmtl Yellow
Kd 0.98 0.78 0.04

newmtl White
Kd 0.96 0.96 0.96

newmtl Light_Green
Kd 0.68 0.85 0.66

newmtl Light_Yellow
Kd 1.00 0.84 0.50

newmtl Tan
Kd 0.69 0.63 0.44

newmtl Light_Violet
Kd 0.69 0.75 0.84

newmtl Purple
Kd 0.40 0.12 0.51

newmtl Dark_Blue_Violet
Kd 0.05 0.24 0.60

newmtl Orange
Kd 0.84 0.47 0.14

newmtl Magenta
Kd 0.56 0.12 0.46

newmtl Lime
Kd 0.65 0.79 0.09

newmtl Dark_Tan
Kd 0.54 0.49 0.38

newmtl Bright_Pink
Kd 1.00 0.62 0.80

newmtl Medium_Lavender
Kd 0.63 0.43 0.73

newmtl Lavender
Kd 0.80 0.64 0.87

newmtl Very_Light_Orange
Kd 0.99 0.76 0.51

newmtl Bright_Reddish_Lilac
Kd 0.54 0.07 0.66

newmtl Reddish_Brown
Kd 0.37 0.19 0.04

newmtl Light_Bluish_Grey
Kd 0.59 0.59 0.59

newmtl Dark_Bluish_Grey
Kd 0.39 0.39 0.39

newmtl Medium_Blue
Kd 0.45 0.59 0.78

newmtl Medium_Green
Kd 0.50 0.77 0.46

newmtl Light_Pink
Kd 1.00 0.80 0.81

newmtl Light_Nougat
Kd 1.00 0.79 0.58

newmtl Medium_Nougat
Kd 0.67 0.49 0.33

newmtl Medium_Lilac
Kd 0.27 0.10 0.57

newmtl Medium_Brown
Kd 0.48 0.36 0.25

newmtl Blue_Violet
Kd 0.11 0.35 0.65

newmtl Nougat
Kd 0.73 0.50 0.35

newmtl Light_Salmon
Kd 0.98 0.72 0.65

newmtl Violet
Kd 0.15 0.27 0.60

newmtl Medium_Violet
Kd 0.28 0.38 0.67

newmtl Medium_Lime
Kd 0.72 0.83 0.15

newmtl Aqua
Kd 0.61 0.84 0.80

newmtl Light_Lime
Kd 0.87 0.92 0.57

newmtl Light_Orange
Kd 0.98 0.65 0.47

newmtl Dark_Nougat
Kd 0.68 0.38 0.25

newmtl Very_Light_Bluish_Grey
Kd 0.78 0.78 0.78

newmtl Bright_Light_Orange
Kd 0.99 0.67 0.00

newmtl Bright_Light_Blue
Kd 0.62 0.76 0.97

newmtl Rust
Kd 0.53 0.17 0.09

newmtl Reddish_Lilac
Kd 0.56 0.33 0.59

newmtl Lilac
Kd 0.34 0.31 0.62

newmtl Bright_Light_Yellow
Kd 1.00 0.93 0.42

newmtl Sky_Blue
Kd 0.47 0.79 0.85

newmtl Dark_Blue
Kd 0.10 0.20 0.35

newmtl Dark_Green
Kd 0.00 0.27 0.10

newmtl Flamingo_Pink
Kd 1.00 0.58 0.76

newmtl Dark_Brown
Kd 0.21 0.13 0.00

newmtl Maersk_Blue
Kd 0.67 0.85 1.00

newmtl Dark_Red
Kd 0.45 0.00 0.07

newmtl Dark_Azure
Kd 0.27 0.61 0.76

newmtl Medium_Azure
Kd 0.41 0.76 0.89

newmtl Light_Aqua
Kd 0.83 0.95 0.92

newmtl Yellowish_Green
Kd 0.89 0.98 0.60

newmtl Olive_Green
Kd 0.47 0.47 0.31

newmtl Sand_Red
Kd 0.53 0.38 0.37

newmtl Medium_Dark_Pink
Kd 0.97 0.52 0.69

newmtl Coral
Kd 1.00 0.43 0.47

newmtl Earth_Orange
Kd 0.85 0.43 0.17

newmtl Sand_Purple
Kd 0.46 0.40 0.49

newmtl Sand_Green
Kd 0.44 0.56 0.49

newmtl Sand_Blue
Kd 0.44 0.51 0.60

newmtl Fabuland_Brown
Kd 0.82 0.47 0.27

newmtl Medium_Orange
Kd 0.96 0.53 0.14

newmtl Dark_Orange
Kd 0.57 0.31 0.11

newmtl Very_Light_Grey
Kd 0.74 0.71 0.65

newmtl Light_Orange_Brown
Kd 0.98 0.61 0.11

newmtl Fabuland_Red
Kd 1.00 0.50 0.08

newmtl Fabuland_Orange
Kd 0.81 0.54 0.28

newmtl Fabuland_Pastel_Green
Kd 0.47 0.99 0.47

newmtl Trans_Dark_Blue
Kd 0.00 0.13 0.63
D 0.50

newmtl Trans_Green
Kd 0.14 0.47 0.25
D 0.50

newmtl Trans_Bright_Green
Kd 0.34 0.90 0.27
D 0.50

newmtl Trans_Red
Kd 0.79 0.10 0.04
D 0.50

newmtl Trans_Dark_Pink
Kd 0.87 0.40 0.58
D 0.50

newmtl Trans_Neon_Orange
Kd 1.00 0.50 0.05
D 0.50

newmtl Trans_Very_Light_Blue
Kd 0.76 0.87 0.94
D 0.50

newmtl Trans_Black
Kd 0.39 0.37 0.32
D 0.50

newmtl Trans_Medium_Blue
Kd 0.33 0.60 0.72
D 0.50

newmtl Trans_Neon_Green
Kd 0.75 1.00 0.00
D 0.50

newmtl Trans_Light_Blue
Kd 0.68 0.91 0.94
D 0.50

newmtl Trans_Bright_Reddish_Lilac
Kd 0.59 0.44 0.62
D 0.50

newmtl Trans_Pink
Kd 0.99 0.59 0.67
D 0.50

newmtl Trans_Yellow
Kd 0.96 0.80 0.18
D 0.50

newmtl Trans_Clear
Kd 0.99 0.99 0.99
D 0.50

newmtl Trans_Purple
Kd 0.65 0.65 0.80
D 0.50

newmtl Trans_Neon_Yellow
Kd 0.85 0.69 0.00
D 0.50

newmtl Trans_Orange
Kd 0.94 0.56 0.11
D 0.50

newmtl Trans_Bright_Light_Orange
Kd 0.99 0.72 0.43
D 0.50

newmtl Trans_Fire_Yellow
Kd 0.98 0.91 0.56
D 0.50

newmtl Trans_Reddish_Lilac
Kd 0.76 0.51 0.65
D 0.50

newmtl Trans_Light_Green
Kd 0.49 0.76 0.57
D 0.50

newmtl Trans_Light_Blue_Violet
Kd 0.42 0.67 0.89
D 0.50

newmtl Chrome_Gold
Kd 0.87 0.76 0.46

newmtl Chrome_Silver
Kd 0.81 0.81 0.81

newmtl Chrome_Antique_Brass
Kd 0.39 0.35 0.30

newmtl Chrome_Black
Kd 0.11 0.16 0.20

newmtl Chrome_Blue
Kd 0.42 0.59 0.75

newmtl Chrome_Green
Kd 0.24 0.70 0.44

newmtl Chrome_Pink
Kd 0.67 0.30 0.56

newmtl Pearl_White
Kd 0.96 0.95 0.87

newmtl Pearl_Very_Light_Grey
Kd 0.60 0.61 0.60

newmtl Pearl_Light_Grey
Kd 0.63 0.63 0.63

newmtl Flat_Silver
Kd 0.54 0.53 0.53

newmtl Pearl_Dark_Grey
Kd 0.28 0.30 0.28

newmtl Metal_Blue
Kd 0.36 0.46 0.56

newmtl Pearl_Light_Gold
Kd 0.87 0.67 0.40

newmtl Pearl_Gold
Kd 0.67 0.50 0.18

newmtl Flat_Dark_Gold
Kd 0.51 0.45 0.31

newmtl Copper
Kd 0.46 0.30 0.23

newmtl Reddish_Gold
Kd 0.67 0.51 0.28

newmtl Metallic_Silver
Kd 0.46 0.46 0.46

newmtl Metallic_Green
Kd 0.42 0.47 0.27

newmtl Metallic_Gold
Kd 0.86 0.67 0.20

newmtl Metallic_Black
Kd 0.04 0.07 0.15

newmtl Metallic_Dark_Grey
Kd 0.24 0.24 0.22

newmtl Metallic_Copper
Kd 0.76 0.50 0.33

newmtl Metallic_Bright_Red
Kd 0.84 0.00 0.15

newmtl Metallic_Dark_Green
Kd 0.00 0.56 0.24

newmtl Milky_White
Kd 0.93 0.93 0.93
D 0.94

newmtl Glow_In_Dark_Opaque
Kd 0.88 1.00 0.69
D 0.94

newmtl Glow_In_Dark_Trans
Kd 0.74 0.78 0.68
D 0.94

newmtl Glow_In_Dark_White
Kd 0.96 0.95 0.84
D 0.94

newmtl Glitter_Trans_Dark_Pink
Kd 0.87 0.40 0.58
D 0.50

newmtl Glitter_Trans_Clear
Kd 0.93 0.93 0.93
D 0.50

newmtl Glitter_Trans_Purple
Kd 0.39 0.00 0.38
D 0.50

newmtl Glitter_Trans_Light_Blue
Kd 0.68 0.91 0.94
D 0.50

newmtl Glitter_Trans_Neon_Green
Kd 0.75 1.00 0.00
D 0.50

newmtl Glitter_Trans_Orange
Kd 0.94 0.56 0.11
D 0.50

newmtl Opal_Trans_Clear
Kd 0.99 0.99 0.99
D 0.94

newmtl Opal_Trans_Light_Blue
Kd 0.68 0.91 0.94
D 0.78

newmtl Opal_Trans_Dark_Pink
Kd 0.87 0.40 0.58
D 0.78

newmtl Glitter_Trans_Bright_Green
Kd 0.34 0.90 0.27
D 0.50

newmtl Speckle_Black_Silver
Kd 0.00 0.00 0.00

newmtl Speckle_Black_Gold
Kd 0.00 0.00 0.00

newmtl Speckle_Black_Copper
Kd 0.00 0.00 0.00

newmtl Speckle_Dark_Bluish_Grey_Silver
Kd 0.39 0.37 0.38

newmtl Rubber_Yellow
Kd 0.98 0.78 0.04

newmtl Rubber_Black
Kd 0.11 0.16 0.20

newmtl Rubber_Blue
Kd 0.12 0.35 0.66

newmtl Rubber_Red
Kd 0.71 0.00 0.00

newmtl Rubber_Orange
Kd 0.84 0.47 0.14

newmtl Rubber_Light_Grey
Kd 0.54 0.57 0.55

newmtl Rubber_Dark_Blue
Kd 0.10 0.20 0.35

newmtl Rubber_Purple
Kd 0.40 0.12 0.51

newmtl Rubber_Lime
Kd 0.65 0.79 0.09

newmtl Rubber_Light_Bluish_Grey
Kd 0.59 0.59 0.59

newmtl Rubber_Flat_Silver
Kd 0.54 0.53 0.53

newmtl Rubber_White
Kd 0.96 0.96 0.96

newmtl Rubber_Green
Kd 0.00 0.52 0.17

newmtl Rubber_Bright_Green
Kd 0.35 0.67 0.25

newmtl Rubber_Magenta
Kd 0.56 0.12 0.46

newmtl Rubber_Medium_Lavender
Kd 0.63 0.43 0.73

newmtl Rubber_Lavender
Kd 0.80 0.64 0.87

newmtl Rubber_Reddish_Brown
Kd 0.37 0.19 0.04

newmtl Rubber_Medium_Blue
Kd 0.45 0.59 0.78

newmtl Rubber_Bright_Light_Yellow
Kd 1.00 0.93 0.42

newmtl Rubber_Dark_Brown
Kd 0.21 0.13 0.00

newmtl Rubber_Dark_Red
Kd 0.45 0.00 0.07

newmtl Rubber_Dark_Azure
Kd 0.27 0.61 0.76

newmtl Rubber_Medium_Azure
Kd 0.41 0.76 0.89

newmtl Rubber_Light_Aqua
Kd 0.83 0.95 0.92

newmtl Rubber_Sand_Green
Kd 0.44 0.56 0.49

newmtl Rubber_Dark_Orange
Kd 0.57 0.31 0.11

newmtl Rubber_Trans_Yellow
Kd 0.96 0.80 0.18
D 0.50

newmtl Rubber_Trans_Clear
Kd 0.99 0.99 0.99
D 0.50

newmtl Rubber_Trans_Bright_Green
Kd 0.34 0.90 0.27
D 0.50

newmtl Rubber_Trans_Red
Kd 0.79 0.10 0.04
D 0.50

newmtl Rubber_Trans_Light_Blue
Kd 0.68 0.91 0.94
D 0.50

newmtl Trans_Black_IR_Lens
Kd 0.00 0.00 0.00
D 0.82

newmtl Magnet
Kd 0.40 0.40 0.38

newmtl Electric_Contact_Alloy
Kd 0.82 0.82 0.82

newmtl Electric_Contact_Copper
Kd 0.68 0.48 0.35

newmtl Trans_Sticker
Kd 1.00 1.00 1.00
D 0.06

newmtl Main_Colour
Kd 1.00 1.00 0.50

newmtl Edge_Colour
Kd 0.50 0.50 0.50


@raysan5
Copy link
Owner

raysan5 commented Dec 19, 2021

It seems an issue with tinyobj_loader_c. raylib is not using latest version of the library (so, this issue may be fixed at this moment) but I'm considering replacing that library by another implementation.

@techbech
Copy link

techbech commented Jan 3, 2022

I'm considering replacing that library by another implementation.

What implementation/library do you have in mind?

@raysan5
Copy link
Owner

raysan5 commented Jan 3, 2022

@techbech After reviewing several libraries I'm considering a custom implementation. The reason is because raylib has several requirements that unfortunately no obj loader provides (or at least I couldn't find a library providing them).

I need:

  • Support obj triangulation on loading
  • Support external material loading (return just path)
  • Support custom memory allocators on compile time (i.e. #define OBJ_LOADER_MALLOC RL_MALLOC)
  • Support loading from memory (instead of just FILE)
  • Minimal stdio dependency (avoid scanf() and similar)

@raysan5
Copy link
Owner

raysan5 commented Apr 23, 2022

Issue is related to an external library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants