Reducing the the texture sizes wouldn't help to improve the CPU usage ad it depends on the videocard...
Adding a delay(1) inside the main loop should relax the CPU enough without ruining the smoothness.
Helix 3D Animation Screensaver
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Guimauve, i have no problems. It runs smoothly. But your code "eats" 100% CPU time in any PCGuimauve wrote:I have tested my code on my computer. So I have little bit reduced the number of model from 10 to 5. Also I have reduced the texture size from 128 pixels X 128 pixels to 64 pixels X 64 pixels.
This I will probably help your computer to render the scene.
Anyway if you have a small configuration PC will have many problems with this code.
It is inadmissible that a screensaver get all 100% CPU use


No. That's not the problem. The problem is explained here: viewtopic.php?t=12747Blade wrote:Reducing the the texture sizes wouldn't help to improve the CPU usage ad it depends on the videocard...
And here: viewtopic.php?t=12825 is a quick solution.
Yes. It depends on how fast is the machine. On fast machines Delay(15) instead Delay(1) works niceBlade wrote:Adding a delay(1) inside the main loop should relax the CPU enough without ruining the smoothness.

Be carefull if you go higher than 1500.
I tried 2500 and things got really jerky.
At 2000 not half bad. At 1500 it was pretty ok.
Do NOT try 10000 models. I did and Windows went nuts with my swap file *laughs* Some insane memory needs.
Btw! 1500 models * 60 polygons = 90000 polygons.
so it seems that my system don't like more than 100000 polygons at least with this test.
A houndred thousand polygons is quite a lot though.
Most 3D characters in games are only 5000 polygons.
Which in this test would equal 84 or so models.
I tried 2500 and things got really jerky.
At 2000 not half bad. At 1500 it was pretty ok.
Do NOT try 10000 models. I did and Windows went nuts with my swap file *laughs* Some insane memory needs.
Btw! 1500 models * 60 polygons = 90000 polygons.
so it seems that my system don't like more than 100000 polygons at least with this test.
A houndred thousand polygons is quite a lot though.
Most 3D characters in games are only 5000 polygons.
Which in this test would equal 84 or so models.
Just in case these command can be usefull to your project :
Sorry for any inconvenients.
Regards
Guimauve
Code: Select all
ProcedureDLL.l SpinLong(No.l, mini.l, maxi.l, increment.l)
No + increment
If No > maxi
No = mini
EndIf
If No < mini
No = maxi
EndIf
ProcedureReturn No
EndProcedure
ProcedureDLL.f SpinFloat(No.f, mini.f, maxi.f, increment.f)
No + increment
If No > maxi
No = mini
EndIf
If No < mini
No = maxi
EndIf
ProcedureReturn No
EndProcedure
ProcedureDLL.b SpinByte(No.b, mini.b, maxi.b, increment.b)
No + increment
If No > maxi
No = mini
EndIf
If No < mini
No = maxi
EndIf
ProcedureReturn No
EndProcedure
ProcedureDLL.w SpinWord(No.w, mini.w, maxi.w, increment.w)
No + increment
If No > maxi
No = mini
EndIf
If No < mini
No = maxi
EndIf
ProcedureReturn No
EndProcedure
Regards
Guimauve