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 / Make cylinder look solid

Author
Message
Joacim
11
Years of Service
User Offline
Joined: 11th Dec 2014
Location:
Posted: 11th Dec 2014 19:16
Hi, I'm completely new to DarkBasic and to 3D programming in general. I wonder how I would go about to make a cylinder look solid, say I wanted to create something like a barrel with a lid, or just a big red push button or for whatever purpose?

I've understood that you can combine different primitives together by creating limbs, so I just wondered if there is a 3D primitive that creates a circle that I can use at the top of a cylinder or do I need to create a plain and texture it with something that has an alpha channel, to make it look like a circle?
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 11th Dec 2014 22:54
I've tried using a flat sphere before but the edges don't line up.

You can generate better primitives from a modeling program like Blender to use in DBP. When I get home I'll save one out and attach it for you unless someone beats me to it.

Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 12th Dec 2014 03:39
Here's a cylinder mesh, as promised.

One caveat though - it may not take a texture properly without UV mapping.

Joacim
11
Years of Service
User Offline
Joined: 11th Dec 2014
Location:
Posted: 12th Dec 2014 05:34
Thanks for the mesh but I was really hoping to be able to just create something very simple via code.

BTW, how do you create a flat sphere?
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 12th Dec 2014 07:26
Unless you have a good reason to do so, creating objects from primitives in code is doing things the hard way. As Derek mentioned, a 3d modeling application is better suited to this task and can export the object as a .x file which you can load into dbpro using the command "load object objNumber, filename$"

Blender is free and fantastic, and well worth the effort to learn.

Joacim
11
Years of Service
User Offline
Joined: 11th Dec 2014
Location:
Posted: 12th Dec 2014 07:39
Yes, I understand that I should be using some 3D modeling software, and I will when I'm going to create something useful. But right now I'm just trying to learn how to use limbs and putting a very simple model together via code. It's simply a learning experiment so I get more used with the language.

So my question remains, do you have any suggestions?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Dec 2014 07:46 Edited at: 12th Dec 2014 07:48
Blender is a beast, you'll have to invest a lot of time into learning how things work before you can even make the most primitive things, plus the DirectX exporter is bugged and you'll have to look for a third party plugin. If you feel like you want to do learn Blender, I highly recommend you follow these video tutorials:
http://gryllus.net/Blender/3D.html

Some easier to use but less powerful alternatives to Blender:
-AC3D (30$)
-Milkshape 3D
-Sketchup (free)

I like offending people. People who get offended should be offended. -- Linus Torvalds
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 12th Dec 2014 08:21
I haven't upgraded to 2.7 yet, but the .x exporter in the 2.6 series works fine, I use it all the time.

If you do pick up Blender and have any questions, feel free to ask. I've got quite a lot of experience with it, and there is a good bit of info regarding it over on the 3d board though you may have to dig around a bit.

Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 12th Dec 2014 20:28
If you want to flatten an object, just SCALE OBJECT n,100,0,100

As far as other stuff I'm putting together a list of free resources here. I need to add much more to it though.

Keep the questions coming... we do enjoy helping new people around here!

Joacim
11
Years of Service
User Offline
Joined: 11th Dec 2014
Location:
Posted: 12th Dec 2014 21:07
Thank you very much for your warm welcome and for all the tips. I've downloaded Blender, but I've never really used a 3D modeling app before. However apart from the Tufts University training course suggested by TheComet I've also found some other useful tutorials on YouTube. Especially one guy there that had a bunch of tutorials, even though he only seem to be using it to render images and not to use the objects in any other fashion.

I'm sure I will have many questions about Blender in the future, and I guess I should post those in the 3D forum(?), however since I'm still being moderated it takes some time for my posts to be approved.
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Dec 2014 05:22
anything specific to modelling or blender itself is probably better on the 3d board, anything to do with getting models from blender into dbpro should be fine here or there. We are a fairly free-form bunch here and it's not a big deal either way, but you will probably find more modelling focused experience on the 3d board, while there will be more coding focused experience here.

MonoCoder
20
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 14th Dec 2014 16:14
You might find this code for generating an n-sided polygon disc or donut helpful.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 14th Dec 2014 20:06
Capped cylinder, quick and simple.

Joacim
11
Years of Service
User Offline
Joined: 11th Dec 2014
Location:
Posted: 16th Dec 2014 15:19
Perfect. Thanks!

Login to post a reply

Server time is: 2026-07-05 11:30:22
Your offset time is: 2026-07-05 11:30:22