Author Topic: 3D object from 2D drawing  (Read 173 times)

Offline dimvolk

  • byte
  • *
  • Posts: 5
    • View Profile
3D object from 2D drawing
« 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: 3D object from 2D drawing
« Reply #1 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.

Offline dimvolk

  • byte
  • *
  • Posts: 5
    • View Profile
Re: 3D object from 2D drawing
« Reply #2 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 , and in 3D get this

Offline AeroShark333

  • long
  • ***
  • Posts: 152
    • View Profile
Re: 3D object from 2D drawing
« Reply #3 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

Offline dimvolk

  • byte
  • *
  • Posts: 5
    • View Profile
Re: 3D object from 2D drawing
« Reply #4 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?

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: 3D object from 2D drawing
« Reply #5 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: 3D object from 2D drawing
« Reply #6 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).

Offline dimvolk

  • byte
  • *
  • Posts: 5
    • View Profile
Re: 3D object from 2D drawing
« Reply #7 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: 3D object from 2D drawing
« Reply #8 on: November 08, 2017, 02:59:17 pm »
Yes, as mentioned above, it's certainly possible. But you have triangulate your mesh somehow.

Offline dimvolk

  • byte
  • *
  • Posts: 5
    • View Profile
Re: 3D object from 2D drawing
« Reply #9 on: November 08, 2017, 07:41:39 pm »
I will try. Thanks for answer