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] Virtual Lathe

Author
Message
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Jul 2009 00:18
Hi all, just something I made tonight for someone as a tech demo, lets you lathe a chunk of wood using the mouse, it's quite fun.

Instructions are on screen. Post up screenshots of any interesting shapes you come up with.




Health, Ammo, and bacon and eggs!

Attachments

Login to view attachments
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 9th Jul 2009 03:12
Awesome. Gave it a go...





I'm bad at this.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Jul 2009 13:14
Is that Alf Hitchcock?

I'm working on a second version that fixes the object normals, has debris particles, and better UV mapping, so the models look much better. Should be uploading that this weekend.


Health, Ammo, and bacon and eggs!
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 12th Jul 2009 14:02
This is quite interesting. I've been outlining a program that would attempt to use the DBP CGS commands to create a model for viewing the intended results of carving operations using a CNC router (not a lathe). However, your vertex manipulation approach may be better. The viewer that my cutting software has embedded is not impressive, and I think a viewer made in DBP would be more flexible, plus I could make it hog the whole screen if desired.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Jul 2009 13:37
This effect is really just for fun, I wouldn't use it for more complex stuff or if it needs to be accurate, well because there's other methods that afford accuracy that I'd use. For instance, using a rail revolve to process the raw data dynamically, which might be a better option for yourself.

If I was making real lathe visualizations then I'd use a sequence of lines to design the cut, then build the mesh from a memblock for displaying in DBPro. So you'd have a parallel set of lines outlining the shape, then this would be used to create the mesh exactly as it is. That way, internals could be milled out to give egg-cup shapes etc.

This same poly line technique could be applied to flat shapes too, like a piece of flat plate in a jet cutter or something like that. It's fairly straightforward to take a loop of poly lines and make a solid shape from them at a set thickness. Then you could drill using the CSG commands, although I probably wouldn't go that route. I would make a big texture for the whole surface, then just draw transparent circles for drill points, then you would see through them. Might not give the nicest results but it is efficient.

One other option would be to have cylinder objects at the material thickness, and position and scale them to show the drill holes. If you then disable zdepth on these objects they would show up over the surface polygons. The other zdepth type commands might have better results, you'd have to experiment with them.

The main concern I have with drilling detailed holes into plate is the affect it has on the polygon count - it grows by a great amount as the mesh gets more and more complex and higher polygon, because it simply can't optimize it.

Put this way, if you took the data from a CAM package for a cutting machine, you could take that and make polylines from it all, then the biggest polyline loop is the actual object, and everything else would be cut outs. I think you'd be better off taking that raw data and making a poly line mesh rather than trying to CSG it out.

I've rambled now of course, but just thought I'd share some thoughts I've had about more accurate methods. Really the most I have planned for this is to let a player make their own club, for a FPS game for instance. Rather than clicking and hoping you have the 'ingredients' like in Fallout3, you would actually whittle the club down on the lathe then pick it up as a weapon. We'll see how that goes though, shame I don't have a WIP FPS game to try it out on.


Health, Ammo, and bacon and eggs!

Login to post a reply

Server time is: 2024-11-22 01:36:59
Your offset time is: 2024-11-22 01:36:59