Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Bug #530: Mesh.RotateY cause child mesh to miss position
Product:
TV3D SDK 6.5
Language:
Visual Basic.NET
Current State:
Closed
Resolution:
Fixed
Created On:
December 16th, 2005
Last Modified:
January 15th, 2006
Reported By:
kenwhitehead
When you have Parent/Child mesh group and rotate the Parent using the RotateY function the Child mesh is missed positioned. For example:

Child.SetPosition(0,0,100)
Parent.SetPosition(1000,0,1000)

This will make a mesh group with the Child offset a 100 units from the Parent on the X axis.

If you execute the following command:
Parent.RotateY(TVM.Deg2Rad(1))

The Parent will rotate one degree but the Child will displace to absolute location 0,0,100.

If you execute either of the following two commands the Child will return to the correct location relative to the Parent:

Parent.SetPosition(1000,0,1000)
or
Child.SetPosition(0,0,100)

It appears the RotateY command correctly calculate the rotation but when it attempts to position the Child Mesh instead of using the Child coordinates as relative it uses them absolute. If you call the Child's Matrix it will show the change in absolute location. Apparently internally the correct numbers are kept since a new position call will return the Child to the correct location relative to the Parent.

Right now the following code seems to work fine as a workaround for a counter colockwise rotation:

Private Sub btnRotateL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRotateL.Click
mParent.RotateY(TVM.Deg2Rad(-1))
Dim vPos As TV_3DVECTOR
vPos = mParent.GetPosition
mParent.SetPosition(vPos.x, vPos.y, vPos.z)
End Sub

Comments:

Posted by SylvainTV on January 15th, 2006 at 4:25 PM
I think all SetParent issues have been fixed.. Reopen another bug report if there is a problem with next dll ;)