I usually share my code, but it is a work in progress, and still quite messy, and uncommented. If there’s anything that interests you in particular, I can share parts of it. (I should caution, however, that you need to be quite familiar with programming in 3D, to understand it).
I started out knowing absolutely nothing, so don’t feel intimidated. Just start small, and work up from there. I think it’s the best fun you can have with Codea, and the best way to start learning professional video game skills.
Very nice! If you are looking for 3d castle assets, and don’t plan on using it for a commercial release… download UDK, there is a bunch of 3d assets included then you can probably pull out of the assets folder and use in Codea, castle assets as well.
If you download Epic Citadel on the app store, it is a castle exploring game that was made with the UDK assets.
Then again, it looks like you are doing the 3D modeling from scratch in Codea, so maybe I am missing the point.
How is the lighting done? It seemed like it was based on the normals at a first glance, but after looking at it some more, there are some vertices of the top of the tower that aren’t facing the light but are bright, and some vertices that are facing the light but are dark.
Yes, it’s based on normals, and yes, I need to fix the vertices on top of the tower.
The normal for any given pixel in the tower is simply the line passing through that point to the centre of the tower at the same height. This gives the tower its rounded appearance despite having only 8 facets.
However, that normal obviously doesn’t work for the vertices on top, so I need to give them their own normals.
Here is an updated version. I was using a shader to make window holes, but that slowed things down, so I went back to solid windows, which is much faster. I made a passage way in the gate house.