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.

DarkBASIC Professional Discussion / how do i create vertexes?

Author
Message
Hayer
14
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 27th Sep 2007 23:47
Hi!
I want to create some vertexes and then "bind" them togheter to make 3d objects, so the questions are as following:
1) How to i create a vertex?
2) How do i bind a like 4 vertexes to create a plain?
3) Do i need any kind of plugin?
4) Is this even possible?

IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Sep 2007 00:03
It's all possible, and there are many different methods to do it - what are you trying to do? Maybe we can advise on the different ways that best match.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
Hayer
14
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 28th Sep 2007 15:28
I want to make a "plain" of vertexes, some thing like this
.....
.....
.....
.....
.....
And then raise some of the vertexes and then "bind" them togheter to create a model.
(Just the basic of a 3d modeling tool)
(Why i want to make this? Just want to learn it )

IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Sep 2007 19:29 Edited at: 28th Sep 2007 19:33
Ok, that's doable - there are several ways:

1. Memblock-based objects
You can find various pieces of code where an object can be built to mimic a matrix.

The downsides are that they are slow to update (memblock to mesh to object) and that there can be several vertices in your object that map to the same point so that when you move one, you have to move all others are the same horizontal position. This makes it difficult and slow to change the height of a point, and the graphics card has to work harder to render your object (a 10x2 strip has 132 vertices).

2. Indexed objects
If you already know the sizes of your terrain, you can pre-generate them with welded vertices. Or you can use one of my utility plug-ins to generate them yourself (latest release, example code in the thread in my last post with code - wavy flag, has a generic routine to generate what you want)

The downside is that you need to write your own support code.
(Terrain built like this will have 33 vertices for a 10x2 strip).

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
Hayer
14
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 28th Sep 2007 22:18 Edited at: 28th Sep 2007 22:21
33 vertices, is that much?

Eh-h.. i cant find ur commands in ur wonderful dlls :/

IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Sep 2007 23:10
You can get the plug-ins from the first link in my signature. The only command from my plug-ins that you need to use is MAKE OBJECT NEW. You'll also need to experiment with the vertexdata commands

You can find the code I was talking about here:
http://forum.thegamecreators.com/?m=forum_view&b=18&t=85209&p=3#m1286203

The main function to concentrate on is MakeObjectPlain. There's also a little helper function you can use called GetPlaneVertex that when given the correct values can be used to locate the vertex you need to update.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
Hayer
14
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 29th Sep 2007 12:34
EH-H... i cant find the function :/

I feel like a total newbi..

Login to post a reply

Server time is: 2020-05-28 23:41:29
Your offset time is: 2020-05-28 23:41:29