Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tipsandtricks [2019/08/29 08:04] – [Bones] admin | tipsandtricks [2019/10/03 13:58] – [Changing Position, RotationAngle or Scale] admin | ||
---|---|---|---|
Line 20: | Line 20: | ||
The number of polygons you should use depends on the quality you require and the platform you are targeting. For mobile devices, somewhere between 300 and 1500 polygons per mesh will give good results, whereas for desktop platforms the ideal range is about 1500 to 4000. You may need to reduce the polygon count per mesh if the game has lots of characters on screen at any given time. | The number of polygons you should use depends on the quality you require and the platform you are targeting. For mobile devices, somewhere between 300 and 1500 polygons per mesh will give good results, whereas for desktop platforms the ideal range is about 1500 to 4000. You may need to reduce the polygon count per mesh if the game has lots of characters on screen at any given time. | ||
+ | |||
+ | ==== Changing Position, RotationAngle or Scale ==== | ||
+ | |||
+ | Changing one of the transformation settings or visual properties of a 3D scene object initializes rendering each time. | ||
+ | So, when you're manipulating more than one object or property this could lead to very bad performance. | ||
+ | Due to that, GorillaViewport provides the BeginUpdate and EndUpdate methods. | ||
+ | Encapsulate your transformations to increase performance. | ||
+ | |||
+ | <file pascal> | ||
+ | procedure TForm1.Timer1Timer(Sender: | ||
+ | begin | ||
+ | GorillaViewport1.BeginUpdate(); | ||
+ | try | ||
+ | GorillaCube1.RotationAngle.Y := GorillaCube1.RotationAngle.Y + 5; | ||
+ | GorillaSphere1.Scale.Point := GorillaSphere1.Scale.Point + Point3D(0.1, | ||
+ | finally | ||
+ | GorillaViewport1.EndUpdate(); | ||
+ | end; | ||
+ | end; | ||
+ | </ |