Author Topic: How to create a custom shape?  (Read 2233 times)

Offline hak47

  • byte
  • *
  • Posts: 2
    • View Profile
How to create a custom shape?
« on: September 03, 2010, 04:25:49 am »
Hi, i'm a newbie of JPCT and very interesting in this.
I want create an custom shape Object3D (Ex: ellipse) if i know x,y,z equation
Code: [Select]
(x^2 / a^2)+(y^2 / b^2)+ (z^2 / c^2) = 1Can i do that?
Thanks!!
« Last Edit: September 03, 2010, 08:07:22 am by hak47 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: How to create a custom shape?
« Reply #1 on: September 03, 2010, 04:42:14 pm »
That formular describes all the points that lie on the ellipse. I'm not sure if this is really helpful when creating a polygon mesh. I would rather take the sin/cos-approach for this. However, you can create custom objects by using the addTriangle(...) methods in Object3D. How to obtain the triangles' coordinates is up to you.

Offline hak47

  • byte
  • *
  • Posts: 2
    • View Profile
Re: How to create a custom shape?
« Reply #2 on: September 03, 2010, 05:34:53 pm »
Thank you, i will try it.