ANN: 3D library

Are you developing tools to extend the LiveCode environment? This is the place to talk about the nuts and bolts of extending our nuts and bolts. If you want to use a LiveCode or third party Environment extension, visit the Using Evironment Extensions forum.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

ANN: 3D library

Post by MaxV » Wed Jul 16, 2014 4:52 pm

Hi,
I'm glad to annuounce that the first version of the 3D library is ready. It odesn't have any dependences, so it can run on any device. It's just pure Livecode.
You can see the project here: https://github.com/angerangel/LCR3D
You can find there a working demo, 3D models to load and working binaries inside the builds folder. Binaries are quicker and without some glitches that the IDE insert.
You can fork the project or propose improvements.
Image
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

netdzynr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 60
Joined: Sat Apr 08, 2006 6:04 am
Contact:

Re: ANN: 3D library

Post by netdzynr » Fri Jul 18, 2014 8:58 pm

This is great -- nice work.

As a test, I replaced the mouseUp command in your behavior with scrollbarDrag, and added lock messages to speed up the rendering. With these additions, rendering occurs near instantaneously here on a MacMini OS X 10.8.5.

on scrollbarDrag --< NEW
lock screen --< ADD
lock messages --< ADD
#model
put the curmodel of this stack into world[1]["model"]
...
set the layer of group "r3d" to 1
unlock messages --< ADD
unlock screen --< ADD
end scrollbarDrag --< NEW

It seems there may be a small rendering issue with Y rotation (saw a couple of instances where the polygons ballooned out), but this is a very impressive stack.

MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: ANN: 3D library

Post by MaxV » Sat Jul 19, 2014 9:33 pm

Thank you for your suggestions, but did you test speed on the other 3D model in the 3D directory?
These are some models:
Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

netdzynr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 60
Joined: Sat Apr 08, 2006 6:04 am
Contact:

Re: ANN: 3D library

Post by netdzynr » Sat Jul 19, 2014 10:50 pm

I tried the goblet model just now, and while the rendering isn't immediate, it's substantially faster with the screen and messages locked.

Basically, my hope was that rendering could update while the scrollbars are dragged in real time (using scrollbarDrag), not after the mouse is released (mouseUp). The script modifications enable rendering to occur more quickly, if not immediately in all cases.

As I said, your stack is very impressive :-)

MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: ANN: 3D library

Post by MaxV » Wed Jul 30, 2014 3:35 pm

Here there are a couple of video:

http://youtu.be/ZuGw40jTjBU

http://youtu.be/ghwPT1jS48A

I'll add the first 3D robot example in github today.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

Re: ANN: 3D library

Post by Peter Wood » Thu Jul 31, 2014 2:49 pm

That's amazing Max!!

PaulDaMacMan
Posts: 190
Joined: Wed Apr 24, 2013 4:53 pm

Re: ANN: 3D library

Post by PaulDaMacMan » Tue Aug 19, 2014 2:18 pm

Wow, amazing that you did this all in LiveCode/RevTalk!
Really nice, Cheers!

PaulDaMacMan
Posts: 190
Joined: Wed Apr 24, 2013 4:53 pm

Re: ANN: 3D library

Post by PaulDaMacMan » Tue Aug 19, 2014 2:44 pm

I hadn't messed around with 3D modeling for awhile but I never heard of .ply or .off formats.
I did find a link to some useful stuff for converting .obj to .ply as well as some info and additional models at this URL:
http://people.sc.fsu.edu/~jburkardt/data/ply/ply.html
A more verbose read me file would be nice.

Surprised at how nicely this runs on my old Core2Duo GMA X3100 laptop on MacOSX 10.6.8!

Thanks for releasing this as GPL!

MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: ANN: 3D library

Post by MaxV » Wed Aug 20, 2014 1:20 pm

PaulDaMacMan wrote:I hadn't messed around with 3D modeling for awhile but I never heard of .ply or .off formats.
I did find a link to some useful stuff for converting .obj to .ply as well as some info and additional models at this URL:
http://people.sc.fsu.edu/~jburkardt/data/ply/ply.html
Well, the file format is not a real problem. 3D library needs only to know solid point coordinates and for each face which point make a face. Every face can be an irregular polygon.
Probably 3D library can accept any file format.
PaulDaMacMan wrote: A more verbose read me file would be nice.
What do you want to know?
PaulDaMacMan wrote: Surprised at how nicely this runs on my old Core2Duo GMA X3100 laptop on MacOSX 10.6.8!
Well, my pc is older than your... so if works on mine works everywhere... :lol:
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: ANN: 3D library

Post by MaxV » Thu Aug 21, 2014 9:00 am

I just added OBJ and PLY file support. Now you can use any file format you like.
Here a cartoon subject from an OBJ file:
Image
Enjoy! :P
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

istech
Posts: 126
Joined: Thu Sep 19, 2013 10:08 am

Re: ANN: 3D library

Post by istech » Fri Oct 17, 2014 8:18 am

This work is excellent MaxV. I will be playing with this over the weekend. What would be your next step for this MaxV? Support Rigging?

MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: ANN: 3D library

Post by MaxV » Fri Oct 17, 2014 1:28 pm

Well, I was waiting some advanced image manipulation system for Livecode. A the present you can't easily stretch or deform image, so I can't add a bitmap to a surface. So you at the present you can't do this:
Image

but if you need some cool effect like a bitmap, just playing with colours, you can create this:
Image

My only way to skip the problem for bitmap is the raycasting technique, but it's very low quality (like the old wolfenstein 3D), this is the result:

Image

However GitHub permit people to ask for feature. So if you need something you can use this forum or GitHub.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6031
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: ANN: 3D library

Post by FourthWorld » Fri Oct 17, 2014 3:10 pm

MaxV - you use REBOL? So cool! I've always admired Mr. Sassenrath and his wonderfully inventive toolkit.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1506
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: ANN: 3D library

Post by MaxV » Fri Oct 17, 2014 5:41 pm

Yes, I used Rebol for some years. Unfortunately Mr. Sassenrath left his precious programming language abandoned. :(
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Extending LiveCode”