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.

Code Snippets / DBP Primitives: Additional commands

Author
Message
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Dec 2005 20:00
Here is a set of functions to make primitives.
You might ask "why? DB has already primitives...".
Well, yes, you're right. But as many of you should know, the primitives cylinder and cone don't have tops and bottoms. Also, you cannot choose the longitude of the primitives.

Here are the functions:


Or a overview of the functions with syntax:


All commands work on one condition: the mesh that has the same number as the object has to be free.

Cheers!

Sven B

Immunity and Annihalation makes Immunihalation...
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 10th Dec 2005 00:37
Cool. I was about to write some of these myself. I may use these instead

Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 12th Dec 2005 10:19
sweet

Zombie Hunter DBPro Open Source Project:
editor: 14% | survive mode: 30% | multiplayer: 0% | story mode: 0% | DEMO: 18%
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 12th Dec 2005 18:13 Edited at: 12th Dec 2005 18:14
Too bad you can't connect the edges. Now they are threatened as separate faces, which causes the "set object smoothing" to do nothing

or does anyone know how to connect edges?

Immunity and Annihalation makes Immunihalation...
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Dec 2005 22:16 Edited at: 12th Dec 2005 23:55
I didn't even look at that lol. I'll see what I can do.

[hrm] Have you tried putting this right at the very end?



[edit] I'll probably remake these anyway using memblocks and math to test the speeds.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Dec 2005 19:25
Good idea. All the primitives are builded in regular triangles, converted in meshes and added as a limb. (Final object has 2 limbs, main + 1 face).

I'm not familiar with memblocks, maybe I'll have to start learn how to use them...

Immunity and Annihalation makes Immunihalation...
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Dec 2005 00:51 Edited at: 15th Dec 2005 09:42
I do not have DBP at work so I can't test this, but here is an theoretical example of your circle function in memblock format. There may be some errors in it but it shows the memblock's format.

[edit] Function corrected when I got home.

Though the UV mapping could be tweaked a bit.

[edit2] added normal cone function and cone with bottom

[edit3] Texture UV bug fixed (I forgot to make the test variable a float lol)



[edit4] Here are some experimental function with slight changes plus a theoretical cylinder and cylinder with ends code. Will test and correct if they don't work when I get home.

[edit5] Fixed codes to work properly. I will try and optimize them when I get time.



Set object smooting makes a world of difference. Both of these have the same number of polys but the one on the right looks much smoother.



Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Dec 2005 19:47 Edited at: 16th Dec 2005 19:48
I just figured out how to use memblocks

Immunity and Annihalation makes Immunihalation...

Login to post a reply

Server time is: 2024-11-23 07:46:50
Your offset time is: 2024-11-23 07:46:50