Hi,
I have a 3D landscape map / object model (.obj) file with streets in it. I have the name boards of the streets in it. Each of the name boards are separate 3D object files that I have successfully loaded on the map. Also i have set the pivots of each board so that when the map is rotated, the name boards are also rotated along with the map.
Now the problem is that when the map is rotated, the name board gets turned and after certain degree of rotation, the name board is not readable as it is rotated along with the map. But I need the name board to keep facing the camera.
I had tried by changing the pivot to object center so i can rotate the board in opp direction when the map is rotated. After this I again change the pivot to the center of the map and rotate the object by multiplying the angle with (-1.0). But this makes the map stand still in one place and map along gets rotated. I have used the below code. Pls indicate what i am doing wrong?
public void onDrawFrame(GL10 gl) {
.
.
//poi is the name board 3D object model
poi.setRotationPivot(df); // where df is the changed simple vector referring the center of the map
poi.rotateY(touchTurn); // to rotate along with the map
poi.setRotationPivot(new SimpleVector(poi.getCenter())); // to get the object's own enter for self rotate
touchTurn = (float) (touchTurn * -1.0); // change the angle to opp direction
poi.rotateY(touchTurn); // for self rotation
.
.
}
I have been breaking my head to resolve this. Need urgent solution as i need to complete my assignment.