Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Manually make a 3d object from scratch?

Author
Message
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Apr 2011 01:10
If it's possible can anyone point me in the right direction of how to manually create a 3d model from scratch. ie. I calculate the vertices, create the faces and add the faces to a mesh. Also, how to UV map the faces, multiple textures of objects.

I have an idea I'd like to play around with similar to how the maps are generated in the game Captive by Mindscape. I don't want to just throw a load of cubes in but to make my own primitives and cut out un-needed faces.

Warning! May contain Nuts!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 11th Apr 2011 01:37 Edited at: 11th Apr 2011 01:39
Here is a function that creates a plane using memblocks, credits to Techlord, code mostly from the open source project:



The only thing you need to do is pass in the vertex positions, I have mine stored in the 'Imposter' structure.

Hope this helps to get you started.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Apr 2011 02:56
Excellent stuff. Thanks again Matty. It will be a start for me. Without trying this so far, this does setup the UV correctly for textures?

Warning! May contain Nuts!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 11th Apr 2011 15:07
The uv data is correct in this code, but then it only creates a plane which is almost the simplest shape you can do, other than a triangle

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 12th Apr 2011 01:08
Are you making a modelling program?

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Apr 2011 03:49
I'm toying with creating a level generator. Instead of using boxes, I want to just use plane shapes, textures and make walls, floors, ceilings, but also generate curved walls. Terrain generators are everywhere now so I thought of making a program that will generate rooms, corridoors, etc.

The idea is, that a load of random rooms are generated then the user can tweak them to their hearts content. Maybe this would be helpful for a 3D version of a rogue type game.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-06-16 02:29:05
Your offset time is: 2024-06-16 02:29:05