PDA

View Full Version : How to smoothly pan a complex 3D object?



HanWu
03-26-2006, 08:14 PM
I am currently developing a 3D engine and i want to implement a panning function on it. The method i am using now is to update the scene(redraw all the object) whenever i move the mouse to a new position. When the number of the object is greater than certain figure say 10,000 triangles, the lag occur. I try to load the same complex object using 3d studio max and I notice that the panning in 3d studio max is very smooth even in the perspective view. Later, i came out with one solution which i copy all the scene and store it as a bitmap. Then i draw the bitmap instead of redraw all the object. But the thing is that, this method can only work on orthographic view. For the perspective view, when we pan the object the back face that blocked by the front face will be seen.

I have two question here,
1 ) how 3d studio max implement the panning function?
2 ) how to implement a smooth panning?

Thanks.

mikael_aronsson
03-26-2006, 11:03 PM
If you get slow panning from 10000 triangles you are doing something wrong, this should work just fine unless you are using software rendering on a slow machine.

The simplest way to give a try is put all the geometry in a display list and see if that improves anything, if the geometry fits in the video memory this should give better performance, but as I said in the beginning, 10000 triangles should not give you any problem so if you could post som code to show how you are doing it we might be able to find the problem.

Mikael

HanWu
03-26-2006, 11:35 PM
I am sorry for that figure. Actually the whole object is consist of 2D line and circle (represented by a few connected lines) and some of the line could have many vertices. The reason why i did't put all the geometry in a display list is my program allow the user to interactively delete or add in new geometry. Now you can treat it as 1 million triangles. I just wonder why 3d studio max can do smooth panning although with a complex object.

RigidBody
03-26-2006, 11:57 PM
have you tried vertex arrays? a vertex array could be modified at any time.

mikael_aronsson
03-28-2006, 06:55 AM
I just wonder why 3d studio max can do smooth panning although with a complex object. Well I guess they do use display lists or vertex buffers :)

Anyway, even with a few 100000 triangles you should still be able to pan very smooth and nice even on a low end video card.