This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
billysback's profile picture

[WIP] 3DDrawer - 3D in CC!

Started by billysback, 28 October 2012 - 03:33 PM
billysback #1
Posted 28 October 2012 - 04:33 PM
[indent=6]3DDrawer[/indent]
This is a proof of concept at the moment, but I aim to turn it in to a full blown 3D draw & printer, just without the 3D explorer.

Information/Overview:
SpoilerSo far this project is at a stage where you can play around with it and get use to the interface, you an now save and open projects as well as edit them.

The window width/height is always set to 7, however it can scroll and when you start a project it asks you for the projects width, height and depth. All of these have a minimum of 7 but no real maximum (none set by the program), moving your cursor "past" the window edge will scroll you around the project.

The projects are saved very inefficiently, but are easy to understand as a human. They are saved under a .tdd, I may exchange the format of the file in a future version but be assure that if I do I will not release it without a converter so that you do not lose any projects.

Controls/Interface:
SpoilerWhen you start the program you will first be asked what command you wish to carry out: create (1) or open (2), enter the appropriate number. You will then be asked what the name of your project is, regardless of the command you are carrying out. After you have determined the name it will then do one of two things depending on the command:
If you selected open there will be a slight pause whilst it opens before either opening the files or generating a new project under than name if it could not find the given project name.
If you selected create it will proceed to ask you for the width, height and depth of your project. Fill these out with numbers, if you want it to be default just put 1 for the dimension you wish to be default.

As you will see in the screenshot down later in this post it is split in to 3 panes, each ignoring one of the dimensions. You move around the x position with the left/right arrow keys, around the y with the up/down arrow keys and around the z with 1 & 0 on the number pad (num lock = on, I think). You then press a key to enter a character, actually entering the characters is working but for some reason the program is not displaying them yet (look at the code if you want, if you can see the cause of this please show me) and that's about it.
(You can also increase/decrease the frame rate (how fast it draws and updates the interface) by using the + and - keys on your number pad, minimum is 0.05, maximum is 2.00 (seconds) )

pressing either enter on your keyboard will save the project.

Screenshot(s):
Spoiler

The # is the cursor, it blinks.




[indent=6]3DPrinter[/indent]

3DPrinter instructions:
Spoiler3DPrinter is a separate program for your turtles (your blueprints must be created on the turtle currently, I am working on a blueprint exchanger to send blueprints between computers, and turtles.

It is simple to use, just fire it up and it will ask you for the project/blueprint name, enter it in.
After this it will ask you for the format, enter it in the format character:slot, sperated by spaces. Example:

a:1 b:2 c:3
would make it so at every occurrence of "a" it would select slot 1, 2 for b and 3 for c.

Once you have entered the format then the program does the rest for you!
However, wait around for a bit in case the computer logs an error, if it says "Printing blueprint…" then everything from then on should be fine.

Pastebin (downloads for both);
Spoiler3DDrawer:
http://pastebin.com/BtGswZt0
3DPrinter:
http://pastebin.com/Smn9yPsJ

Please tell me what you think!'

NOTE:
I decided to repost this in programs because the code now works, it's just still in beta :D/>/>
(Please delete old topic mods: http://www.computerc...-in-cc-program/)
Cruor #2
Posted 28 October 2012 - 04:41 PM
Deleted old thread. Next time please just report the thread and ask for deletion, much easier to notice then.
TangentDelta #3
Posted 28 October 2012 - 04:54 PM
So this just draws layers of a 3D object?
billysback #4
Posted 28 October 2012 - 05:10 PM
Yes and no, the interface also lets you draw the 3D object inside of CC, without external programs or anything.
tommyroyall #5
Posted 28 October 2012 - 07:04 PM
One thing I would love to see is this thing being able to save model files, then to read them up again and display them layer-by-layer :D/>/>.
billysback #6
Posted 28 October 2012 - 07:28 PM
what do you mean by "model" files? the blueprints?

so your suggesting another interface which is view only so that you can view each y layer at a time? or each of a selected layer at a time?
tommyroyall #7
Posted 28 October 2012 - 09:49 PM
I am suggesting a blueprint, perhaps a .mdl file of which had an array/table containing each coordinate combination that was filled, and the others would be read as empty.

Also, yes, or perhaps even another program. Just something to read them layer by layer (y layer).

I see this being the start of an amazing tool for redstone prototyping.
billysback #8
Posted 28 October 2012 - 10:08 PM
Sorry, I still don't full understand you:

For the "New blueprint" bit are you suggesting a new save format, if so that may be a good idea.

for the read then layer by layer, that's what my 3DDrawer "open" function does, you realize that right?

Or are you suggesting a new way of editing? I could incredibly easily add a new type of interface option which makes it only show one window contains the x/z positions in the current y layer…
tommyroyall #9
Posted 29 October 2012 - 01:21 PM
For the new blueprint I am suggesting a new save format.

And no, my apologies, I didn't realize that. I was suggesting something in an API so that other programs could read them up into tables.

And I was suggesting a new way of editing based on (y layers).
mackthehobbit #10
Posted 01 November 2012 - 07:04 PM
This has actually been an inspiration for another project of mine :P/>/>
Don't worry, it's not a copy of this, it's just similar in a way.