kottore / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

Sprite2D not scaled ocrrectly when using PerspectiveLens #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

A swf and source is attached.

What is the expected output? What do you see instead?

In the example I made 2 spheres that zoom in and out, and in between a
Sprite2d looking like an arrow. The arrow is scaled so it shuld just fill
up the space between the spheres. This is the case when using the default
ZoomFocusLens, but if I change to PerspectiveLens the arrow doesn't scale
together with the spheres. In the example app it is possible to toggle
between the 2 lens types to reproduce the problem.

What version of the product are you using? On what operating system?

3.4.0

Please provide any additional information below.

Original issue reported on code.google.com by li.mik...@gmail.com on 6 Dec 2009 at 2:36

Attachments:

GoogleCodeExporter commented 8 years ago
btw.. also tested the svn version 6 dec 2009 and the issue is present there as 
well

Original comment by li.mik...@gmail.com on 6 Dec 2009 at 2:49

GoogleCodeExporter commented 8 years ago
Possible fix for the problem... On line 46 in 
away3d.core.project.SpriteProjector
there is a hard coded calculation:

_sprite.scaling*_view.camera.zoom / (1 + _screenVertices[2] / 
_view.camera.focus)

Replacing this with:

_sprite.scaling*_view.camera.lens.getPerspective(_screenVertices[2])

Solves the problem for me... 

I'm not that familiar with the internal workings of Away3D, so don't copy and 
paste
this without giving it a bit of thought first.. :)

Original comment by li.mik...@gmail.com on 6 Dec 2009 at 3:14

GoogleCodeExporter commented 8 years ago
this has been fixed in the fp10 branch, and is now fixed in the latest revision 
of the fp9 branch:

http://code.google.com/p/away3d/source/detail?r=2679

Original comment by rob.bate...@gmail.com on 4 Jul 2010 at 11:19