Apply Shaded Material To Collada Objects

1 message Options
Embed this post
Permalink
CodeJockey1

Apply Shaded Material To Collada Objects

Reply Threaded More More options
Print post
Permalink
I'm hoping somebody can help me out.  I'm trying to apply shaded materials to a collada object at runtime.  I understand that I can manually create a material and then apply it to a child object, but I'm hoping to find a more dynamic solution.  I would like to apply a given shader to the materials that are loaded by the DAE file instead of having to know the object names and material paths.  I've tried looping over the child object's triangles and creating a shaded material from the original material like listed below, but when Papervision3D tries to render it I get an error.  Can anybody help?

for (var i:int = 0; i < length; i++){
    var m1:MaterialObject3D = Triangle3D(currentObject.geometry.faces[i]).material;
    var bm:BitmapMaterial = new BitmapMaterial(BitmapMaterial(m4.materials[0]).bitmap.clone(), true);
    var ps:PhongShader = new PhongShader(light, 0xffffff, 0x666666, 3);
    var sm:ShadedMaterial = new ShadedMaterial(bm, ps);
    m1.material = sm;
}

Thanks,

CodeJockey


On Mon, Nov 2, 2009 at 10:14 AM, <[hidden email]> wrote:
Send Papervision3D mailing list submissions to
       [hidden email]

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
       [hidden email]

You can reach the person managing the list at
       [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Papervision3D digest..."

Today's Topics:

  1. How do I use GIT (John Brookes)
  2. Aw esome DJ website (A bit over selling title but i need your
     advise :)) (Monsieur A)
  3. Re: Aw esome DJ website (A bit over selling title but i need
     your advise :)) (Slopester)
  4. Re: Aw esome DJ website (A bit over selling title but i need
     your advise :)) (Gordon Everett)
  5. Changing Registration Point Dynamically (Lars Schwarz)
  6. Re: Aw esome DJ website (A bit over selling title but i need
     your advise :)) (Shane Johnson)
  7. Re: Changing Registration Point Dynamically (John Brookes)
  8. Re: Changing Registration Point Dynamically (Boris Munser)
  9. Re: Changing Registration Point Dynamically (Lars Schwarz)


---------- Forwarded message ----------
From: John Brookes <[hidden email]>
To: papervision3d <[hidden email]>
Date: Mon, 2 Nov 2009 12:57:14 +0000
Subject: [Papervision3D] How do I use GIT
Tried clicking on the shiny download button on the PV git page, that gets the master.
Forked PV tried same, still master.
Installed GitGUI (windows), used the PV Clone URL still got the master.
tried my fork Clone URL, throws an error.

How do you download a branch? the idiots guide version :(


---------- Forwarded message ----------
From: Monsieur A <[hidden email]>
To: [hidden email]
Date: Mon, 2 Nov 2009 05:24:16 -0800 (PST)
Subject: [Papervision3D] Aw esome DJ website (A bit over selling title but i need your advise :))

Hello,

Yes I know another website beta test ... I promise this one is funny and the
musics are great :)

http://www.adenek.com/temp/norman/

What I would like to know is :
- Is it running ok on your computer (please tell me what computer you use if
it's laggy ...)
- Do you understand well how to navigate (Looks dump question but you will
see :))
- Do you like it (Maybe the main question in fact).

Thx a lot in advance




--
View this message in context: http://old.nabble.com/Awesome-DJ-website-%28A-bit-over-selling-title-but-i-need-your-advise-%3A%29%29-tp26156901p26156901.html
Sent from the Papervision3D mailing list archive at Nabble.com.





---------- Forwarded message ----------
From: "Slopester" <[hidden email]>
To: <[hidden email]>
Date: Mon, 2 Nov 2009 13:42:38 -0000
Subject: Re: [Papervision3D] Aw esome DJ website (A bit over selling title but i need your advise :))
nothing about that I don't like  :o)

Runs like a charm here but my machine is a beast.
Found navigation through close after opening page, very cool.  Nice to discover the other commands too - feels real nice to use that nav as well once u find it.
I've had some fun experiences with sound spec + PV (plus draw+blur!) myself - found the framerates pretty good.  Will be interested to hear what others feed back about performance.

very nice m8

slopes


----- Original Message ----- From: "Monsieur A" <[hidden email]>
To: <[hidden email]>
Sent: Monday, November 02, 2009 1:24 PM
Subject: [Papervision3D] Aw esome DJ website (A bit over selling title but i need your advise :))



Hello,

Yes I know another website beta test ... I promise this one is funny and the
musics are great :)

http://www.adenek.com/temp/norman/

What I would like to know is :
- Is it running ok on your computer (please tell me what computer you use if
it's laggy ...)
- Do you understand well how to navigate (Looks dump question but you will
see :))
- Do you like it (Maybe the main question in fact).

Thx a lot in advance




--
View this message in context: http://old.nabble.com/Awesome-DJ-website-%28A-bit-over-selling-title-but-i-need-your-advise-%3A%29%29-tp26156901p26156901.html
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.698 / Virus Database: 270.14.44/2475 - Release Date: 11/01/09 19:39:00





---------- Forwarded message ----------
From: Gordon Everett <[hidden email]>
To: <[hidden email]>
Date: Mon, 2 Nov 2009 13:54:52 +0000
Subject: Re: [Papervision3D] Aw esome DJ website (A bit over selling title but i need your advise :))

It runs fine on my Win XP/Sp3 2GB 3Ghz seems-quite-old machine

I didn't get the navigation at first but when I did I thought it was great! Really cool site in my opinion

Regards
Gordon Everett

 
My preferred email address: [hidden email]

 My Blog: http://flashgordonmedia.blogspot.com/

 







> Date: Mon, 2 Nov 2009 05:24:16 -0800
> From: [hidden email]
> To: [hidden email]
> Subject: [Papervision3D] Aw esome DJ website (A bit over selling title but i need your advise :))
>
>
> Hello,
>
> Yes I know another website beta test ... I promise this one is funny and the
> musics are great :)
>
> http://www.adenek.com/temp/norman/
>
> What I would like to know is :
> - Is it running ok on your computer (please tell me what computer you use if
> it's laggy ...)
> - Do you understand well how to navigate (Looks dump question but you will
> see :))
> - Do you like it (Maybe the main question in fact).
>
> Thx a lot in advance
>
>
>
>
> --
> View this message in context: http://old.nabble.com/Awesome-DJ-website-%28A-bit-over-selling-title-but-i-need-your-advise-%3A%29%29-tp26156901p26156901.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org


Download Messenger onto your mobile for free. Learn more.


---------- Forwarded message ----------
From: Lars Schwarz <[hidden email]>
To: [hidden email]
Date: Mon, 2 Nov 2009 14:56:40 +0100
Subject: [Papervision3D] Changing Registration Point Dynamically
hi all,

i was wondering if there's a way to dynamically change an 3D object's
registration point.
 in my case i want to rotate a plane on the Y axis. i'm using two
different planes (landscape
and portrait) where only one of them is visible once (like a double
sided plane with different
dimensions).

the portrait plane is centered, the landscape plane is "right
aligned". now i want to rotate
the portrait one on the "regular" center but the landscape one on the
"center-difference"
between those 2 planes... let's say the portrait registration point
for rotation is 0, but the
landscape registration point for rotation should be something like -300...

i don't want/can't use a wrapper container here, so i'm really looking
for a way to change
the "internal" registration point...

thanks: lars




---------- Forwarded message ----------
From: Shane Johnson <[hidden email]>
To: [hidden email]
Date: Mon, 02 Nov 2009 14:00:09 +0000
Subject: Re: [Papervision3D] Aw esome DJ website (A bit over selling title but i need your advise :))
Runs 'sweet as' on my old work pc:

HP Pentium 4 - 2.80 Ghz - 2Gb Ram
Windows XP SP3

like it!

Shane



Monsieur A wrote:
Hello,

Yes I know another website beta test ... I promise this one is funny and the
musics are great :)  
http://www.adenek.com/temp/norman/

What I would like to know is : - Is it running ok on your computer (please tell me what computer you use if
it's laggy ...)
- Do you understand well how to navigate (Looks dump question but you will
see :))
- Do you like it (Maybe the main question in fact).

Thx a lot in advance




 





---------- Forwarded message ----------
From: John Brookes <[hidden email]>
To: [hidden email]
Date: Mon, 2 Nov 2009 14:10:26 +0000
Subject: Re: [Papervision3D] Changing Registration Point Dynamically
Move all the vertices one direction and the do3d an equal amount in the other. So it stays in the same position.
Or
Use rotationMatrixWithReference()

2009/11/2 Lars Schwarz <[hidden email]>
hi all,

i was wondering if there's a way to dynamically change an 3D object's
registration point.
 in my case i want to rotate a plane on the Y axis. i'm using two
different planes (landscape
and portrait) where only one of them is visible once (like a double
sided plane with different
dimensions).

the portrait plane is centered, the landscape plane is "right
aligned". now i want to rotate
the portrait one on the "regular" center but the landscape one on the
"center-difference"
between those 2 planes... let's say the portrait registration point
for rotation is 0, but the
landscape registration point for rotation should be something like -300...

i don't want/can't use a wrapper container here, so i'm really looking
for a way to change
the "internal" registration point...

thanks: lars

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org



---------- Forwarded message ----------
From: "Boris Munser" <[hidden email]>
To: <[hidden email]>
Date: Mon, 2 Nov 2009 15:12:54 +0100
Subject: Re: [Papervision3D] Changing Registration Point Dynamically
something like that:

public function changeRegistration(obj:Plane, xoffset:Number,yoffset:Number,zoffset:Number):void
 {
 for each (var v:Vertex3D in obj.geometry.vertices)
 {
  v.x += xoffset;
  v.y += yoffset;
  v.z += zoffset;
 }

 obj.x -= xoffset;
 obj.y -= yoffset;
 obj.z -= zoffset;

 }

?


----- Original Message ----- From: "Lars Schwarz" <[hidden email]>
To: <[hidden email]>
Sent: Monday, November 02, 2009 2:56 PM
Subject: [Papervision3D] Changing Registration Point Dynamically


hi all,

i was wondering if there's a way to dynamically change an 3D object's
registration point.
in my case i want to rotate a plane on the Y axis. i'm using two
different planes (landscape
and portrait) where only one of them is visible once (like a double
sided plane with different
dimensions).

the portrait plane is centered, the landscape plane is "right
aligned". now i want to rotate
the portrait one on the "regular" center but the landscape one on the
"center-difference"
between those 2 planes... let's say the portrait registration point
for rotation is 0, but the
landscape registration point for rotation should be something like -300...

i don't want/can't use a wrapper container here, so i'm really looking
for a way to change
the "internal" registration point...

thanks: lars

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org






---------- Forwarded message ----------
From: Lars Schwarz <[hidden email]>
To: [hidden email]
Date: Mon, 2 Nov 2009 15:13:58 +0100
Subject: Re: [Papervision3D] Changing Registration Point Dynamically
that will do, thanks!

On Mon, Nov 2, 2009 at 3:12 PM, Boris Munser <[hidden email]> wrote:
> something like that:
>
> public function changeRegistration(obj:Plane,
> xoffset:Number,yoffset:Number,zoffset:Number):void
>  {
>  for each (var v:Vertex3D in obj.geometry.vertices)
>  {
>   v.x += xoffset;
>   v.y += yoffset;
>   v.z += zoffset;
>  }
>
>  obj.x -= xoffset;
>  obj.y -= yoffset;
>  obj.z -= zoffset;
>
>  }
>
> ?
>
>
> ----- Original Message ----- From: "Lars Schwarz" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, November 02, 2009 2:56 PM
> Subject: [Papervision3D] Changing Registration Point Dynamically
>
>
>> hi all,
>>
>> i was wondering if there's a way to dynamically change an 3D object's
>> registration point.
>> in my case i want to rotate a plane on the Y axis. i'm using two
>> different planes (landscape
>> and portrait) where only one of them is visible once (like a double
>> sided plane with different
>> dimensions).
>>
>> the portrait plane is centered, the landscape plane is "right
>> aligned". now i want to rotate
>> the portrait one on the "regular" center but the landscape one on the
>> "center-difference"
>> between those 2 planes... let's say the portrait registration point
>> for rotation is 0, but the
>> landscape registration point for rotation should be something like -300...
>>
>> i don't want/can't use a wrapper container here, so i'm really looking
>> for a way to change
>> the "internal" registration point...
>>
>> thanks: lars
>>
>> _______________________________________________
>> Papervision3D mailing list
>> [hidden email]
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>
>
> _______________________________________________
> Papervision3D mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>



--
Lars Schwarz
Heiligengeist Höfe 2
26121 Oldenburg
T +49(0)441 36110338
M +49(0)151 1727 8127
W www.bitrocker.com
TWTTR: www.twitter.com/bitrocker



_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org



_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org