www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: hak47 on September 03, 2010, 04:25:49 am

Title: How to create a custom shape?
Post by: hak47 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!!
Title: Re: How to create a custom shape?
Post by: EgonOlsen 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.
Title: Re: How to create a custom shape?
Post by: hak47 on September 03, 2010, 05:34:53 pm
Thank you, i will try it.