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] - Column Editor (Rough Draft)

Author
Message
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 12th Feb 2014 19:40 Edited at: 14th Feb 2014 04:58
This snippet allows you to draw 2D lines which represent extrusions of a vertically segmented column.
The program will then render the actual (symmetrical) 3D column from your 2D layout.

NOTE: To get a clean object with this early version it's advised to add lines from TOP to BOTTOM only.
However, starting a line where the previous one was seems to look alright.




Feel free to revamp this code into something better!



Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Feb 2014 22:52
Though I can't really give you any points for code structure, it's still a neat program.

Quote: "NOTE: To get a clean object with this early version it's advised to add lines from TOP to BOTTOM only."

What you can do is sort your lines by Y-coordinate before rendering the column

Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 14th Feb 2014 00:44 Edited at: 14th Feb 2014 00:49
Quote: "Though I can't really give you any points for code structure, it's still a neat program."


That's the nicest thing any Silver Codemaster has ever said to me.

Sadly, code structure is usually the last thing on my agenda.. sometimes I will restructure an entire program at the very end of development (on the rare occasion I actually finish something.)

Quote: "What you can do is sort your lines by Y-coordinate before rendering the column."


LoL... now that you mention it, that would only take about 4-5 lines of code, huh? I'll definitely add that later this evening or tomorrow.

Also, I wanted to be able to close the very top of the cylinder, and drawing a line length of zero was an issue, so I did a test using the line if L>1 then move object Dummy,abs(xFinal#*1) to keep the top closed. This was in the "if yy#>0" section.. to close the bottom we can do if L<LineCount-1 then... in the other section.

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Feb 2014 10:57 Edited at: 14th Feb 2014 10:58
Hi there.
@ Derek Darkly
I like it !!, that remember me when I start making my Dbpro Lathe Tool. It's a great code with just a few lines




I'm not a grumpy grandpa

Attachments

Login to view attachments
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 14th Feb 2014 16:25 Edited at: 14th Feb 2014 16:39
Quote: "I like it !!, that remember me when I start making my Dbpro Lathe Tool. It's a great code with just a few lines"


Thanks Chafari - I feel like I am still just a beginner, but it's fun to learn.

Here's a pawn I made by pasting a silhouette image into the program and drawing lines over it. Then I texture painted in Blender:



Attachments

Login to view attachments
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Feb 2014 19:50
You have improved your program a lot , that looks better and better , Now it really looks like a chess pawn

I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 14th Feb 2014 21:23 Edited at: 14th Feb 2014 21:23
Thanks Chafari... I was watching Blender tutorial last night when it occurred to me that I could paste images into the program and draw lines over it. Easy-Peasy!



Attachments

Login to view attachments
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Feb 2014 22:30
Yes, most 3D programs use to load a background image as a reference. You can implement your program, adding the ability of refine the model at runtime.



http://www.youtube.com/watch?v=rGNMtmAPMHY

I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 15th Feb 2014 00:51
Awesome, Chafari!
Your on-the-fly editor looks way more user-friendly than mine.

Do you have it available somewhere in the forums?

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th Feb 2014 10:37
Thanks Derek Darkly. My first attempt to do a lathe was in 15th Nov 2011 . I made some poor tests .You can download the program here.

http://forum.thegamecreators.com/?m=forum_view&t=191389&b=1

I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 15th Feb 2014 16:11
Thank you again!

Great application - if I knew about this before I could have saved some time, but now this gives me another idea for an automated version!

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th Feb 2014 19:59
Quote: " if I knew about this before I could have saved some time, but now this gives me another idea for an automated version!"


I suppose you have found the same problems I did. The bigest challenge for me, was to give a correct UV to the model. Now that you have learned to work with vertexdata, you have half the way done.

Cheers.

I'm not a grumpy grandpa
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Feb 2014 20:01
Any control over how many segments it makes around when building the object?

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th Feb 2014 20:30 Edited at: 15th Feb 2014 21:22
Quote: "Any control over how many segments it makes around when building the object?"


Exactly !!. we don't know the user inputs, so we have to wait until know how many entries make the user, then we have to divide the texture as many entries and scroll texture the same division.

BTW did you know that with this program we can make pipes?




I'm not a grumpy grandpa

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-16 23:27:48
Your offset time is: 2024-04-16 23:27:48