www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: gugugu on March 03, 2008, 09:16:55 am

Title: Creating Object3D
Post by: gugugu on March 03, 2008, 09:16:55 am
Hello, this is my first post and i want to say "Hello everybody!".

My target is to create an Object3D from some Vertice.
If I try this code:
Code: [Select]
Object3D tmp=Object3D.createDummyObj();
tmp.addTriangle(new SimpleVector(-8.0f, 8.0f, 0.0f),
              new SimpleVector( 8.0f,  8.0f, 0.0f),
              new SimpleVector( 8.0f, -8.0f, 0.0f));
I get the following Error:
Quote
[ Mon Mar 03 08:22:03 CET 2008 ] - ERROR: Polygon index out of range - object is too large!

Can anyone help me?

Title: Re: Creating Object3D
Post by: EgonOlsen on March 03, 2008, 09:21:37 am
Hi and welcome!

A dummy object is of size 0. You can't add any vertices to it. You have to use the Object3D(<int>) constructor instead where <int> is the number of triangles you expect your new object to have.
Title: Re: Creating Object3D
Post by: gugugu on March 03, 2008, 09:23:07 am
Thanks! That was fast! I'll try and come back later on any further problems!!