0

I'd like to understand why the particles presented by the particle system change their scales when the camera looks/moves around. While it is ok that the particle have to be scaled according the fov to fit the 3d scene, i however noticed some strange behavior i couldn't explain nor understand and i'm willing to share an example code that displays my problem:

var w=640,h=640;

http://jsfiddle.net/JFQCM/2/

In this example the canvas is set to 640x640 which makes the particle's presentation look almost ok, i don't see the problem here regarding my question, but..

var w=640,h=360;

http://jsfiddle.net/JFQCM/1/

switching the viewport's height to h=360 px (which is intended to represent a different monitor aspect ratio) the particles now start to dancing to my eyes it seems to me like the engine is using a miscalculated aspect ratio of some sort, causing their visual appearance break the 3d scene composition. They just doesn't play well with the red rectangles anymore, you see? I can't find the words to explain it better.

The second part of my question would be to ask, can i do anything against this behavior, mean to keep the particles in a "visually steady" size, as in the previous example?

Nevertheless this problem may doesn't look interesting in some cases, i happened to placed some huge smeared textures on these particles to construct a cloud system, yet however they're always changing their size and positions when the camera moves and rotates, they'll never look realistic to me like this on my 16:10 monitor.

I also noticed when i change the fov setting of the perspective camera, the particles won't be scaled properly, causing they appear farther away/closer to each other, but they remain the same size whatever fov i set. There is also an another issue, when the camera gets very close to a particle, it just starts to move out of the screen in a very strange manner.

I believe this could be a bug; Or am I just missing something here?

tshepang
  • 12,111
  • 21
  • 91
  • 136
sch5
  • 1
  • Did you call `camera.updateProjectionMatrix()` after you changed the FOV? Also, your questions are likely too vague to be answerable. – WestLangley Sep 13 '13 at 04:47
  • I may can make the question simple, probably this will do it as well: If you change the FOV in any of the example to 95 and run , why the particles will appear like 10 times bigger than the red squares, while they appeared almost the same before the change? – sch5 Sep 13 '13 at 05:12
  • As written, a sprite's rendered size is somewhat arbitrary. That is something that could be improved. Look at the `particle_basic` shader in `WebGLShaders.js`. – WestLangley Sep 13 '13 at 06:39
  • Thank you for pointing me to the direction, digging a "little deeper" gave me a tons of ideas where to look to find my answers, however i am thinking about to drop the whole idea using the ParticleSystem (and particle_basic) since they doesn't seem to respect the viewing frustum's characteristic, which results in the anomalies i have noticed. http://jsfiddle.net/vYrTH/ This fiddle is intended to compare the particle's behavior with meshes those rotated by using the camera's matrix which results a very similar behavior, but respecting the fov settings as well, they keep their size steady. – sch5 Sep 13 '13 at 22:20

0 Answers0