# 3D Castle you can walk through

For those who may be interested, I’m currently attempting to build a 3D castle entirely in Codea, and writing it up as I go, here.

https://coolcodea.wordpress.com/2015/03/12/3d-walk-through-castle/

This gives you an idea of how it’s starting to look

Another amazing piece of work by @Ignatz =D>

It reminds me of the film. i wanna study your code.

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).

3D is too complicated for me, i should study basics.

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.

Thanks, i’ll try my best to do as u said.

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.

Then again, it looks like you are doing the 3D modeling from scratch in Codea, so maybe I am missing the point.

Thanks, i first start small.

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.

Looking good. I wasn’t sure: are you using my library for this?

And I presume that you have obtained your licence to crenellate.

@LoopSpace - I haven’t used your library yet, because I wanted a lot of control over the mesh, but it is quite likely to be needed later on.

Crenellation is a complete pain, so many extra faces just for a bit of decoration!

Spiral staircase inside tower

(Any jerkiness is caused by the video capture)

@Crumble thanks, whats next? copy udkgame and then?

nice!
Maybe: make the walls thick?

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.