it worked this way:

var sv:ScreenVertex = cam.screen(guide, guide.vertices[10]);
spot.x = sv.x + view.width * 0.5;
spot.y = sv.y + view.height * 0.5;

however when the guide (which is a circle) is behind the camera, the spot
don't disappear.

On Thu, Apr 15, 2010 at 11:07 AM, Michael Iv <[email protected]> wrote:

> I found a similar post registering  camera.screen projection problem:
>
> http://groups.google.com/group/away3d-dev/browse_thread/thread/2d331c736767ee65
>
> Fabrice or someone else can help here ? Is there a kind of bug with getting
> screen  2d coords  of vertices ?
>
> On Wed, Apr 14, 2010 at 9:19 PM, Omar Fouad <[email protected]>wrote:
>
>> I'm also trying to set the x of the spot sprite outside the view to
>> camera.screen(3dObjectInsideTheView).x, but they are not overlaying.
>> I mean the sprite is not overlaying on the object that is inside the
>> view3D.
>> Shouldn't camera.screen(object3D).x return the coinciding coordinate out
>> of the view3D (translate into screen coords)?
>>
>> On Wed, Apr 14, 2010 at 7:54 PM, Fabrice3D <[email protected]> wrote:
>>
>>> Perhaps... Glad we could bring you to ideas.
>>>
>>> Sent from an iPhone without Flash
>>>
>>> On Apr 14, 2010, at 19:08, Omar Fouad <[email protected]> wrote:
>>>
>>> Fabrice's talk is too complicated :)
>>>
>>> On Wed, Apr 14, 2010 at 7:00 PM, Michael Iv < <[email protected]>
>>> [email protected]> wrote:
>>>
>>>> If you need your hot spots to be in 3d space and relative to camera
>>>> facing direction this will not help . You should try the approach of 
>>>> Fabrice
>>>> .
>>>>
>>>>
>>>> On Wed, Apr 14, 2010 at 7:54 PM, Omar Fouad < <http://omarfouad.net>
>>>> omarfouad.net@ <http://gmail.com>gmail.com> wrote:
>>>>
>>>>> Nope! I've tried lots of things. I've been reading somewhere about
>>>>> camera.screen(object3D). It should return the screen 2D coordinates that 
>>>>> are
>>>>> relative an object3D inside the view. But I don't know what is missing 
>>>>> here.
>>>>> I give the screen x and y to it and it moves strangely across the screen.
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Apr 14, 2010 at 4:42 PM, Omar Fouad < <http://omarfouad.net>
>>>>> omarfouad.net@ <http://gmail.com>gmail.com> wrote:
>>>>>
>>>>>> I was thinking of doing something else.  In Away3D there a class
>>>>>> called MovieClipSprite, which is a "plane" that always faces the camera 
>>>>>> and
>>>>>> takes a DisplayObject as its material. I was thinking of adding those
>>>>>> movieClipSprites inside an ObjectContainer3D that also contains the
>>>>>> cylinder. Those movieClipSprites are the spots I need and they would be 
>>>>>> on
>>>>>> top of the cylinder. This way when moving the camera, I should see both
>>>>>> cylinder and spots rotating in the same positions. The beauty of the
>>>>>> MovieClipSprite is that it doesn't transform by any means.
>>>>>> I'll try and keep you updated.
>>>>>>
>>>>>> Cordially.
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 14, 2010 at 4:27 PM, Michael Iv < <[email protected]>
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> I am still not sure what Omar tries to do . Is that about hotspots
>>>>>>> deifined directly on constant material areas or these are the hot spots 
>>>>>>> that
>>>>>>> are always relative to the camera direction? If it is the first then
>>>>>>> Fabrice's second solution looks really the best approach .
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Apr 14, 2010 at 5:20 PM, Fabrice3D < <[email protected]>
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Using the Ray class you would indeed with the projection of two rays
>>>>>>>> get your uv's coordinates and via barycentric formula from the faces 
>>>>>>>> hitted
>>>>>>>> extract a rectangle. The defined rect could then be compared with your
>>>>>>>> mouse3devent... the hard way.
>>>>>>>>
>>>>>>>> Simplest way would certainly be to define 2d rect on map. the
>>>>>>>> mouseEvent3D returns you the uv's, define a Point from these x,y 
>>>>>>>> extracted
>>>>>>>> from the uv's and a simple PointInRect would tell you if you have a 
>>>>>>>> hit.
>>>>>>>>
>>>>>>>> Fabrice
>>>>>>>>
>>>>>>>>
>>>>>>>> On Apr 14, 2010, at 2:55 PM, Omar Fouad wrote:
>>>>>>>>
>>>>>>>> Well thanks! This approach is what I've mentioned in the post.
>>>>>>>> However the dilemma is how to move the spots, according the rotation 
>>>>>>>> of the
>>>>>>>> camera. I don't need the spots to rotate around the x or the y axes, 
>>>>>>>> the can
>>>>>>>> be flat, but on the same specific place on the cylinder's material.
>>>>>>>> BTW thanks for your answers!
>>>>>>>>
>>>>>>>> On Wed, Apr 14, 2010 at 2:49 PM, Michael Iv <<[email protected]>
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Basically it can be made easier: I would create the hot spots as
>>>>>>>>> billboards like DirSprite3D  and make their alpha to zero . Than I 
>>>>>>>>> would
>>>>>>>>> wrap them with ObjectContainer ,then you can read the rotation angle 
>>>>>>>>> of your
>>>>>>>>> camera , or if you rotate the cylinder instead then read its rotation 
>>>>>>>>> . And
>>>>>>>>> after that use that value for angular displacement , I mean  move your
>>>>>>>>> container   on the spherical path (basic trigonometry) according to 
>>>>>>>>> that
>>>>>>>>> rotation . I could write it here but I am at work now , sorry .
>>>>>>>>> may at the weekend I ll post this case in my 
>>>>>>>>> blog.(<http://blog.alladvanced.net/>
>>>>>>>>> http://blog.alladvanced.net)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, Apr 14, 2010 at 3:39 PM, Omar Fouad <<http://omarfouad.net/>
>>>>>>>>> omarfouad.net@ <http://gmail.com/>gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> No :) I missed yours
>>>>>>>>>>
>>>>>>>>>> On Wed, Apr 14, 2010 at 2:23 PM, Michael Iv <<[email protected]>
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> What? I missed your point or you missed mine?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Apr 14, 2010 at 3:16 PM, Omar Fouad <<http://omarfouad.net/>
>>>>>>>>>>> omarfouad.net@ <http://gmail.com/>gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> huh?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Apr 14, 2010 at 2:12 PM, Michael Iv 
>>>>>>>>>>>> <<[email protected]>
>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> If you want to set the hot spots that will be located always
>>>>>>>>>>>>> relative to the camera direction you can set directional sprites 
>>>>>>>>>>>>> facing the
>>>>>>>>>>>>> camera with zer0 alpha.And copying camera transformation matrix 
>>>>>>>>>>>>> and
>>>>>>>>>>>>> direction (can cast a Ray) you can figure out where to move these 
>>>>>>>>>>>>> objects
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wed, Apr 14, 2010 at 2:56 PM, Omar Fouad 
>>>>>>>>>>>>> <<http://omarfouad.net/>
>>>>>>>>>>>>> omarfouad.net@ <http://gmail.com/>gmail.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have a cylinder that has applied to it a BitmapMaterial,
>>>>>>>>>>>>>> which is the panorama image (landscape 360). I've zoomed the 
>>>>>>>>>>>>>> camera properly
>>>>>>>>>>>>>> so it looks great while panning left, right, up, and down.
>>>>>>>>>>>>>> What I really need to do now is to set a hot-spot on that
>>>>>>>>>>>>>> view. in this example (link:
>>>>>>>>>>>>>> <http://www.egypt.travel/?flashinstalled=2>
>>>>>>>>>>>>>> http://www.egypt.travel/?flashinstalled=2 ) i believe the
>>>>>>>>>>>>>> spots are not movieclip materials placed on top of the bitmap 
>>>>>>>>>>>>>> material (or
>>>>>>>>>>>>>> their rotationY angle would change with the camera rotation). I 
>>>>>>>>>>>>>> believe,
>>>>>>>>>>>>>> that is a layer placed on the stage on top of the View3D, that 
>>>>>>>>>>>>>> moves
>>>>>>>>>>>>>> according the camera panAngle.
>>>>>>>>>>>>>> But how can I give the spots x and y props and then, update
>>>>>>>>>>>>>> them while panning the camera?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks in advance.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Cordially.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Michael Ivanov ,Programmer
>>>>>>>>>>>>> Neurotech Solutions Ltd.
>>>>>>>>>>>>> Flex|Air |3D|Unity|
>>>>>>>>>>>>> <http://www.neurotechresearch.com/>www.neurotechresearch.com
>>>>>>>>>>>>> Tel:054-4962254
>>>>>>>>>>>>>  <[email protected]>[email protected]
>>>>>>>>>>>>> <[email protected]>[email protected]
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Michael Ivanov ,Programmer
>>>>>>>>>>> Neurotech Solutions Ltd.
>>>>>>>>>>> Flex|Air |3D|Unity|
>>>>>>>>>>> <http://www.neurotechresearch.com/>www.neurotechresearch.com
>>>>>>>>>>> Tel:054-4962254
>>>>>>>>>>>  <[email protected]>[email protected]
>>>>>>>>>>> <[email protected]>[email protected]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Michael Ivanov ,Programmer
>>>>>>>>> Neurotech Solutions Ltd.
>>>>>>>>> Flex|Air |3D|Unity|
>>>>>>>>> <http://www.neurotechresearch.com/>www.neurotechresearch.com
>>>>>>>>> Tel:054-4962254
>>>>>>>>>  <[email protected]>[email protected]
>>>>>>>>> <[email protected]>[email protected]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Michael Ivanov ,Programmer
>>>>>>> Neurotech Solutions Ltd.
>>>>>>> Flex|Air |3D|Unity|
>>>>>>> <http://www.neurotechresearch.com>www.neurotechresearch.com
>>>>>>> Tel:054-4962254
>>>>>>> <[email protected]>[email protected]
>>>>>>> <[email protected]>[email protected]
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Michael Ivanov ,Programmer
>>>> Neurotech Solutions Ltd.
>>>> Flex|Air |3D|Unity|
>>>> <http://www.neurotechresearch.com>www.neurotechresearch.com
>>>> Tel:054-4962254
>>>>  <[email protected]>[email protected]
>>>> <[email protected]>[email protected]
>>>>
>>>>
>>>
>>
>
>
> --
> Michael Ivanov ,Programmer
> Neurotech Solutions Ltd.
> Flex|Air |3D|Unity|
> www.neurotechresearch.com
> Tel:054-4962254
> [email protected]
> [email protected]
>
>

Reply via email to