Mietze
Community Member

Posts: 278
Pleeease, don't let it crash!
|
 |
« on: September 30, 2008, 03:11:32 AM » |
|
Hey, I just found out that TVMiniMesh.SetRotationArray() does not work as expected in the managed dll. I expect the following code to do the same, but unfourtunately the SetRotationArray() seems to add a random rotation. The TVMiniMesh uses Meshs for instancing and no billboards. m_pMiniMesh.SetRotationArray(nInstances, vaRotationArray);
for (int i = 0; i < nInstances; i++) m_pMiniMesh.SetRotation(vaRotationArray[i].x, vaRotationArray[i].y, vaRotationArray[i].z, i);
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1381
Discipline in training
|
 |
« Reply #1 on: September 30, 2008, 03:05:07 PM » |
|
Are you using radians or degrees?
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
Mietze
Community Member

Posts: 278
Pleeease, don't let it crash!
|
 |
« Reply #2 on: October 01, 2008, 12:31:39 AM » |
|
Radians
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1381
Discipline in training
|
 |
« Reply #3 on: October 01, 2008, 01:43:51 PM » |
|
...and what you you have set for the TVEngine.SetAngleSystem? Is that Degrees or radians?
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
Mietze
Community Member

Posts: 278
Pleeease, don't let it crash!
|
 |
« Reply #4 on: October 01, 2008, 02:08:23 PM » |
|
Also radians  Meh.. I use TV3D for almost five years 
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1381
Discipline in training
|
 |
« Reply #5 on: October 01, 2008, 09:57:54 PM » |
|
hmm.....strange, perhaps internally it's always using degrees....unless.... when you say it "adds random rotation", does it seem to change rotation even when you do not?
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
Mietze
Community Member

Posts: 278
Pleeease, don't let it crash!
|
 |
« Reply #6 on: October 02, 2008, 12:25:22 AM » |
|
Nope, this would only happen when using billboards with a certain rotation mode, wouldn't it? 
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1381
Discipline in training
|
 |
« Reply #7 on: October 02, 2008, 04:52:40 PM » |
|
well what I meant is, is there erratic rotation? Like say you set rotation to (0,0,0). Does it go to (0,90,23) then to (234,210,23), (34,22,230), (4,95,242)....ect? Or does it stay still after you set the rotation but rotations just seems off?
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
Mietze
Community Member

Posts: 278
Pleeease, don't let it crash!
|
 |
« Reply #8 on: October 03, 2008, 04:03:43 AM » |
|
It seems like there is no erratic rotation, its more like a constant factor. The weird thing is, that after a SetRotation(0, 0, 0) a GetRotation() returns something different :/
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1381
Discipline in training
|
 |
« Reply #9 on: October 03, 2008, 12:21:42 PM » |
|
hmm....does SetMatrixArray work?
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
ZaPPZion
Community Member

Posts: 341
|
 |
« Reply #10 on: October 03, 2008, 12:22:22 PM » |
|
do you have any rotations applied when adding the mesh to the minimesh? like a random value to make it look more natural? might be a bug that it keeps that value?
|
|
|
|
|
Logged
|
|
|
|
|
SylvainTV
|
 |
« Reply #11 on: October 05, 2008, 07:14:13 AM » |
|
Well I don't know exactly what's going on, the code seems ok. It's maybe the managed wrapper that corrupts the data someway. But BTW I fixed a bug in that function, because it didn't work if you were in Degrees mode 
|
|
|
|
|
Logged
|
|
|
|
|