www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: dimvolk on October 28, 2017, 12:44:07 am

Title: 3D object from 2D drawing
Post by: dimvolk on October 28, 2017, 12:44:07 am
Hi
How create 3D object/model from 2D drawing on button click (or vice versa)?
For example: in app i draw 2D cube (round or other) and on click it should be converted/transformed to 3D model.
Any help or link, example?
Thanks
Title: Re: 3D object from 2D drawing
Post by: EgonOlsen on November 02, 2017, 09:37:09 am
No idea. jPCT-AE doesn't prevent you from doing this, but it doesn't offer support for it either. You somehow have to triangulate the 2d drawing and then create an Object3D from it.
Title: Re: 3D object from 2D drawing
Post by: dimvolk on November 05, 2017, 01:10:13 pm
Thanks for answer.
What i need is to create scene/model based on points from 2D touch points.
For example is in 2D (https://i.stack.imgur.com/O0Fr6.png), and in 3D get this (https://i.stack.imgur.com/9sRja.png)
Title: Re: 3D object from 2D drawing
Post by: AeroShark333 on November 05, 2017, 01:28:51 pm
Maybe this can help you experiment a little:
http://www.jpct.net/wiki/index.php?title=Create_a_cube
Title: Re: 3D object from 2D drawing
Post by: dimvolk on November 06, 2017, 07:11:55 pm
Thanks for answer.
But i'm not understand how get a distance between points. And what if is needed to create object based on curve line (bezier, round etc). it is possible?
Title: Re: 3D object from 2D drawing
Post by: MichaelJPCT on November 07, 2017, 02:59:39 am
these all can be done. but much maths calculation is involved, if you don't know how to calculate distance between points, you should find someone who is good in maths, geometry, computer graphics, java programming to do this. it takes a lot to do the work, you can't learn all these in a few weeks.
Title: Re: 3D object from 2D drawing
Post by: EgonOlsen on November 07, 2017, 07:44:04 am
If you have the shape in 2d defined by the end points, you need some sort for triangulation algorithm to convert it into 2d triangles (i.e. in a plane). Once you have that, you can extend it in 3d pretty easily. There are several triangulation algos out there, just google for it. It also depends on your objects. It's getting more complex, if your objects can be convex as well (your example is concav).
Title: Re: 3D object from 2D drawing
Post by: dimvolk on November 08, 2017, 02:52:29 pm
in 2D its all i did. Now in app i can draw any figures i need, change distance between  this points, restart app and again change this drawn figures. Now i need visualize this in 3D.
What if create scene in 3D in new activity from intented points (coordinates)?
in 2D i save this points in constant class. is it possible create scene from them?
Thanks
Title: Re: 3D object from 2D drawing
Post by: EgonOlsen on November 08, 2017, 02:59:17 pm
Yes, as mentioned above, it's certainly possible. But you have triangulate your mesh somehow.
Title: Re: 3D object from 2D drawing
Post by: dimvolk on November 08, 2017, 07:41:39 pm
I will try. Thanks for answer