Open Skaruts opened 4 years ago
Well I atually figured it out shortly after posting this... This works.
let maps = cast[ptr UncheckedArray[MaterialMap]](mats[0].maps) # <-- I had neglected '.maps'
Although I'm still having trouble getting anything to render -- I just get blank screen when I run it -- which may be related to what I'm doing there. When I press escape to quit I get a storage access error:
... first_person_maze.nim(123)
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
and line 123 is
UnloadModel(model)
But model
isn't nil...
I'm trying to convert this sample myself. Something seems to be wrong with collisions.
Thanks. There are problems with collisions in the original too, though.
Well, what I found so far is that problem lies with mesh generation - it only creates disjointed triangles with mangled plane on 0,0,0. Not so sure why, investigating.
I was trying to port the first person maze example, and came across this:
And I'm not being able to translate that second line there, because it involves C array pointers, and I don't quite know how to work with those in Nim. Someone suggested that I use UncheckedArrays, and I used that successfully with Image data in another example, but here I'm not managing to. I tried this but didn't work: