Author Topic: Creating Object3D  (Read 1960 times)

Offline gugugu

  • byte
  • *
  • Posts: 3
    • View Profile
Creating Object3D
« 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?


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Creating Object3D
« Reply #1 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.

Offline gugugu

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Creating Object3D
« Reply #2 on: March 03, 2008, 09:23:07 am »
Thanks! That was fast! I'll try and come back later on any further problems!!