[Papervision3D] Michael:Moving on top of Sphere (fredfoc)
fredfoc
contact at fredfoc.com
Wed Aug 5 01:02:35 PDT 2009
Hi mickael,
if I understand correctly your question, you want to move an object at
the surface of a sphere. If you use cartesian coordinates (x, y, z),
then they have to respect the equation x^2+y^2+z^2 = R^2 if your sphere
is centered on the origin. This equation is nice but can be a mess to
compute (you make x move between -R and R and y the same and then you
compute z to get the position of the point at the surface of your sphere
and of course you get two points as it's a ^2 polynome).
Now if you use spherical coordinates (almost latitude and longitude),
then the equation is more simple as you only have to fix the distance R
and that's it. Then you have method to convert spherical to cartesian
coordinates and you're done.
But maybe I misunderstood your question.
You should also use quaternion and slerp (SphericaL intERPolation) to
make your camera and/or object move smoothly on/around your sphere
because if you use euler (normal X, Y and Z rotations as any 3D rotation
can be divided into 3 rotations - Euler prooved that this is why it's
called Euler angles) angles you're gonna have some blocking effect when
rotating ( what's called "gimball lock")
Andy Zupko made a nice geo demo on how to use quaternion and how to
position points on a sphere and make them move - well it was the sphere
which was moving but if you think about it it's the same thing (I can't
remember the link put just google it :-)
Regards.
Fred
Michael Iv a écrit :
> Fred ,Than you very much but could you be more descriptive . Do you mean the
> object must be moved by vertex coordinates?
>
> On Wed, Aug 5, 2009 at 1:12 AM, <papervision3d-request at osflash.org> wrote:
>
>
>> Send Papervision3D mailing list submissions to
>> papervision3d at osflash.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>> or, via email, send a message with subject or body 'help' to
>> papervision3d-request at osflash.org
>>
>> You can reach the person managing the list at
>> papervision3d-owner at osflash.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Papervision3D digest..."
>>
>>
>> Today's Topics:
>>
>> 1. Re: Michael:Moving on top of Sphere (fredfoc)
>> 2. Re: How to capture events from a MXLM component ina
>> MovieMaterial? (Strange Loop Studios)
>> 3. Dance ribbons (speedok)
>> 4. Re: Dance ribbons (Ross Sclafani)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Tue, 04 Aug 2009 21:41:42 +0200
>> From: fredfoc <contact at fredfoc.com>
>> Subject: Re: [Papervision3D] Michael:Moving on top of Sphere
>> To: papervision3d at osflash.org
>> Message-ID: <4A788EF6.40303 at fredfoc.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Spherical coordinates are good for that :-)
>> Regards
>> Fred
>>
>> Michael Iv a ?crit :
>>
>>> How can I move an Object on top of Sphere so that the sphere's surface
>>>
>> used
>>
>>> as it's floor?
>>>
>>> On Tue, Aug 4, 2009 at 10:00 PM, <papervision3d-request at osflash.org>
>>>
>> wrote:
>>
>>>
>>>> Send Papervision3D mailing list submissions to
>>>> papervision3d at osflash.org
>>>>
>>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>> or, via email, send a message with subject or body 'help' to
>>>> papervision3d-request at osflash.org
>>>>
>>>> You can reach the person managing the list at
>>>> papervision3d-owner at osflash.org
>>>>
>>>> When replying, please edit your Subject line so it is more specific
>>>> than "Re: Contents of Papervision3D digest..."
>>>>
>>>>
>>>> Today's Topics:
>>>>
>>>> 1. Event for Know when object is outside to the scene (ths otra)
>>>> 2. Re: Event for Know when object is outside to the scene
>>>> (nospam at therossman.org)
>>>> 3. How to capture events from a MXLM component in a
>>>> MovieMaterial? (aboteler)
>>>>
>>>>
>>>> ----------------------------------------------------------------------
>>>>
>>>> Message: 1
>>>> Date: Tue, 4 Aug 2009 12:26:18 +0000 (GMT)
>>>> From: ths otra <ths_otra at yahoo.fr>
>>>> Subject: [Papervision3D] Event for Know when object is outside to the
>>>> scene
>>>> To: papervision3D at osflash.org
>>>> Message-ID: <509729.4763.qm at web24406.mail.ird.yahoo.com>
>>>> Content-Type: text/plain; charset="utf-8"
>>>>
>>>> Hello Papervision List !
>>>>
>>>> I'm new in papervision and i need to use the class Text3D and
>>>> LetterMaterial.
>>>>
>>>> For optimizing better, i would like to know if it exists an Event could
>>>>
>> say
>>
>>>> to me when an Text3D object was outside scene ... like the Event:
>>>> Event.ACTIVATE for example ?
>>>>
>>>> Thanks in advance and sorry for my english... ;-)
>>>>
>>>>
>>>>
>>>> Thomas
>>>>
>>>>
>>>>
>>>> -------------- next part --------------
>>>> An HTML attachment was scrubbed...
>>>> URL: <
>>>>
>>>>
>> http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090804/6290dbf9/attachment-0001.html
>>
>>>> ------------------------------
>>>>
>>>> Message: 2
>>>> Date: Tue, 4 Aug 2009 07:37:56 -0700
>>>> From: nospam at therossman.org
>>>> Subject: Re: [Papervision3D] Event for Know when object is outside to
>>>> the scene
>>>> To: papervision3d at osflash.org
>>>> Message-ID:
>>>> <
>>>>
>> 089affc224a91760cc27ca48e2bb7513.squirrel at webmail.therossman.org>
>>
>>>> Content-Type: text/plain;charset=iso-8859-1
>>>>
>>>>
>>>> Maybe this will help?
>>>>
>>>>
>>>>
>>>>
>> http://pv3d.org/2009/07/01/test-if-a-plane-is-within-the-view-of-the-camera-aka-testing-if-culled/
>>
>>>> Cheers
>>>>
>>>>
>>>>
>>>>> Hello Papervision List !
>>>>>
>>>>> I'm new in papervision and i need to use the class Text3D and
>>>>> LetterMaterial.
>>>>>
>>>>> For optimizing better, i would like to know if it exists an Event could
>>>>> say to me when an Text3D object was outside scene ... like the Event:
>>>>> Event.ACTIVATE for example ?
>>>>>
>>>>> Thanks in advance and sorry for my english... ;-)
>>>>>
>>>>>
>>>>>
>>>>> Thomas
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Papervision3D mailing list
>>>>> Papervision3D at osflash.org
>>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> ------------------------------
>>>>
>>>> Message: 3
>>>> Date: Tue, 4 Aug 2009 10:05:47 -0700 (PDT)
>>>> From: aboteler <aboteler at harris.com>
>>>> Subject: [Papervision3D] How to capture events from a MXLM component
>>>> in a MovieMaterial?
>>>> To: papervision3D at osflash.org
>>>> Message-ID: <24812045.post at talk.nabble.com>
>>>> Content-Type: text/plain; charset=us-ascii
>>>>
>>>>
>>>> Hello,
>>>>
>>>> I have a 3D virtual world containing 50+ objects where each has a
>>>>
>> separate
>>
>>>> instantiation of an MXML Canvas component attached to a MovieMaterial
>>>> painted on the objects front face. The component has a button, slider,
>>>> checkbox, and a radio button. Also in that MXML file I specify an event
>>>> handler for when a click happens.
>>>>
>>>> Unfortunately, the event handler is never called. I need help with
>>>> understanding the eventing flow in this case and how to fix it. I
>>>>
>> believe
>>
>>>> it has to do with the event going to PV3D and then somehow needs to flow
>>>>
>> to
>>
>>>> the particular instantiation.
>>>>
>>>> Thanks,
>>>>
>>>> Aaron
>>>>
>>>> FYI,
>>>>
>>>> Here's the MXML class
>>>> <?xml version="1.0" encoding="utf-8"?>
>>>> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
>>>> width="200" height="200" backgroundColor="#FFEA00">
>>>>
>>>> <mx:VBox>
>>>> <mx:Button id="btn" label="button" width="80" />
>>>> <mx:HSlider width="230" />
>>>> <mx:CheckBox label="Checkbox" />
>>>> <mx:RadioButton label="Radio" />
>>>> </mx:VBox>
>>>> <mx:Script>
>>>> <![CDATA[
>>>> public function youClicked(evt : MouseEvent) : void
>>>> {
>>>> trace("mouse button clicked");
>>>> }
>>>> ]]>
>>>> </mx:Script>
>>>> </mx:Canvas>
>>>>
>>>> And, here's the section of code that adds it to the stage and cube:
>>>>
>>>> var material:MovieMaterial;
>>>> material = new MovieMaterial(new MXMLNode(),false,true,true);
>>>> material.smooth = true;
>>>> material.interactive = true;
>>>> material.allowAutoResize = false;
>>>>
>>>> // Material list with MovieMaterial used on the front, the rest being
>>>>
>> flat
>>
>>>> shaded
>>>> var colorMaterial:MaterialObject3D = new ColorMaterial(0x02AABB);
>>>> colorMaterial.interactive = true;
>>>>
>>>> var materialList:MaterialsList = new
>>>> MaterialsList({"all":colorMaterial,"front":material});
>>>>
>>>> // create a new interactive projector
>>>> var projector:ProjectorCube = new ProjectorCube(id,materialList,
>>>> NODE_WIDTH,
>>>> NODE_DEPTH, NODE_HEIGHT);
>>>> projector.addEventListener(InteractiveScene3DEvent.OBJECT_DOUBLE_CLICK,
>>>> onMouseDoubleClickOnObject);
>>>> projector.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,
>>>> onMouseOverObject);
>>>> projector.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,
>>>> onMouseOutObject);
>>>>
>>>> // add it to the display list
>>>> node.visible=false;
>>>> this.addChild(node);
>>>>
>>>> // add the projector to the scene, being part of the object group
>>>> scene.addChild(projector);
>>>> --
>>>> View this message in context:
>>>>
>>>>
>> http://www.nabble.com/How-to-capture-events-from-a-MXLM-component-in-a-MovieMaterial--tp24812045p24812045.html
>>
>>>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------
>>>>
>>>> _______________________________________________
>>>> Papervision3D mailing list
>>>> Papervision3D at osflash.org
>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>>
>>>>
>>>> End of Papervision3D Digest, Vol 35, Issue 6
>>>> ********************************************
>>>>
>>>>
>>>>
>>>
>>> __________ Information provenant d'ESET NOD32 Antivirus, version de la
>>>
>> base des signatures de virus 4306 (20090804) __________
>>
>>> Le message a ?t? v?rifi? par ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>>>
>>> __________ Information provenant d'ESET NOD32 Antivirus, version de la
>>>
>> base des signatures de virus 4306 (20090804) __________
>>
>>> Le message a ?t? v?rifi? par ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Tue, 4 Aug 2009 20:51:11 +0100
>> From: "Strange Loop Studios" <info at strangeloopstudios.com>
>> Subject: Re: [Papervision3D] How to capture events from a MXLM
>> component ina MovieMaterial?
>> To: <papervision3d at osflash.org>
>> Message-ID:
>> <mailman.2265.1249423931.20297.papervision3d_osflash.org@
>> osflash.org>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Hi all,
>>
>>
>>
>> Just a quickie to add to this! I have a similar example I'm working on
>> which
>> exhibits the same behaviour but in mine some of the components will work as
>> expected while others don't. Anything with a button seems to works fine
>> (meaning an mx:Panel with a mx:Button inside it mapped to a MovieMaterial).
>> I add no special listeners - just let the component do its default
>> behaviour. DateChooser is a weird one too - if it's on its own I get
>> rollovers working on the dates and the buttons at the top also work but if
>> it's in a scene with other components as planes I lose the rollovers.
>>
>>
>>
>> Ta
>>
>> Doug
>>
>>
>>
>> _____
>>
>> From: papervision3d-bounces at osflash.org
>> [mailto:papervision3d-bounces at osflash.org] On Behalf Of xero
>> Sent: 04 August 2009 20:04
>> To: papervision3d at osflash.org
>> Subject: Re: [Papervision3D] How to capture events from a MXLM component
>> ina
>> MovieMaterial?
>>
>>
>>
>> i will never get it from that snip.
>>
>> please post the full code
>>
>> (or email me directly.)
>> ____ ___
>> \ \/ /___________ ____
>> .\ // __ \_ __ \/ _ \
>> ./ \ ___/ | | \( <_> )
>> /___/\ \___ >__|---\____/
>> | \_/ \/ |
>> | xero harrison |
>> | xero.nu at gmail.com |
>> | http://xero.nu |
>> | http://fontvir.us |
>> | http://hexarray.nu |
>> | http://xero.owns.us |
>> `---------------------'
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: aboteler <aboteler at harris.com>
>> To: papervision3D at osflash.org
>> Date: Tue, 4 Aug 2009 10:05:47 -0700 (PDT)
>> Subject: [Papervision3D] How to capture events from a MXLM component in a
>> MovieMaterial?
>>
>> Hello,
>>
>> I have a 3D virtual world containing 50+ objects where each has a separate
>> instantiation of an MXML Canvas component attached to a MovieMaterial
>> painted on the objects front face. The component has a button, slider,
>> checkbox, and a radio button. Also in that MXML file I specify an event
>> handler for when a click happens.
>>
>> Unfortunately, the event handler is never called. I need help with
>> understanding the eventing flow in this case and how to fix it. I believe
>> it has to do with the event going to PV3D and then somehow needs to flow to
>> the particular instantiation.
>>
>> Thanks,
>>
>> Aaron
>>
>> FYI,
>>
>> Here's the MXML class
>> <?xml version="1.0" encoding="utf-8"?>
>> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
>> width="200" height="200" backgroundColor="#FFEA00">
>>
>> <mx:VBox>
>> <mx:Button id="btn" label="button" width="80" />
>> <mx:HSlider width="230" />
>> <mx:CheckBox label="Checkbox" />
>> <mx:RadioButton label="Radio" />
>> </mx:VBox>
>> <mx:Script>
>> <![CDATA[
>> public function youClicked(evt : MouseEvent) : void
>> {
>> trace("mouse button clicked");
>> }
>> ]]>
>> </mx:Script>
>> </mx:Canvas>
>>
>> And, here's the section of code that adds it to the stage and cube:
>>
>> var material:MovieMaterial;
>> material = new MovieMaterial(new MXMLNode(),false,true,true);
>> material.smooth = true;
>> material.interactive = true;
>> material.allowAutoResize = false;
>>
>> // Material list with MovieMaterial used on the front, the rest being flat
>> shaded
>> var colorMaterial:MaterialObject3D = new ColorMaterial(0x02AABB);
>> colorMaterial.interactive = true;
>>
>> var materialList:MaterialsList = new
>> MaterialsList({"all":colorMaterial,"front":material});
>>
>> // create a new interactive projector
>> var projector:ProjectorCube = new ProjectorCube(id,materialList,
>> NODE_WIDTH,
>> NODE_DEPTH, NODE_HEIGHT);
>> projector.addEventListener(InteractiveScene3DEvent.OBJECT_DOUBLE_CLICK,
>> onMouseDoubleClickOnObject);
>> projector.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,
>> onMouseOverObject);
>> projector.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,
>> onMouseOutObject);
>>
>> // add it to the display list
>> node.visible=false;
>> this.addChild(node);
>>
>> // add the projector to the scene, being part of the object group
>> scene.addChild(projector);
>> --
>> View this message in context:
>>
>> http://www.nabble.com/How-to-capture-events-from-a-MXLM-component-in-a-Movie
>> Material--tp24812045p24812045.html<http://www.nabble.com/How-to-capture-events-from-a-MXLM-component-in-a-Movie%0AMaterial--tp24812045p24812045.html>
>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>
>>
>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>>
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by <http://www.mailscanner.info/> MailScanner, and is
>> believed to be clean.
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090804/74d2dc42/attachment.html
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Tue, 4 Aug 2009 14:57:49 -0700 (PDT)
>> From: speedok <speedok at gmail.com>
>> Subject: [Papervision3D] Dance ribbons
>> To: papervision3D at osflash.org
>> Message-ID: <24817038.post at talk.nabble.com>
>> Content-Type: text/plain; charset=us-ascii
>>
>>
>> Aloha,
>>
>> http://www.flashbookmarks.com/demos/danceribbons/ Dance Ribbons
>>
>> hope you like it.
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dance-ribbons-tp24817038p24817038.html
>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Tue, 4 Aug 2009 18:11:53 -0400
>> From: Ross Sclafani <ross.sclafani at gmail.com>
>> Subject: Re: [Papervision3D] Dance ribbons
>> To: papervision3d at osflash.org
>> Message-ID: <1114AF00-B625-400C-B168-E22B442C176C at gmail.com>
>> Content-Type: text/plain; charset=US-ASCII; format=flowed
>>
>> speed++
>> good music. nice animation.
>> is the motion driven by sound levels or captured otherwise?
>> _r
>> On Aug 4, 2009, at 5:57 PM, speedok wrote:
>>
>>
>>> Aloha,
>>>
>>> http://www.flashbookmarks.com/demos/danceribbons/ Dance Ribbons
>>>
>>> hope you like it.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>>
>> http://www.nabble.com/Dance-ribbons-tp24817038p24817038.html
>>
>>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>>
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>> End of Papervision3D Digest, Vol 35, Issue 8
>> ********************************************
>>
>>
>
>
>
> __________ Information provenant d'ESET NOD32 Antivirus, version de la base des signatures de virus 4306 (20090804) __________
>
> Le message a été vérifié par ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
>
> __________ Information provenant d'ESET NOD32 Antivirus, version de la base des signatures de virus 4306 (20090804) __________
>
> Le message a été vérifié par ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
More information about the Papervision3D
mailing list