ParallelGraphics Forums
Authoring Tools
You are here: [Forums]::[Authoring Tools]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
  Authoring Tools

Subject: Re: comlicated "fields"-usage
Sender: Mikhail 22.08.03 04:59
>Can anyone help me with this problem:
>I try to change the color of following
>code with VB6:
>
>DEF AB1 Transform
>{
> children
> [
> Transform
> {
> children
> [
> Anchor
> {
> children
> [
> Shape
> {
> appearance Appearance
> {
> material Material
> {
> diffuseColor 0.8 0.8 0.8
> }
> }
> geometry Box
> {
> size 20 20 0.15
> }
> }
> ]
> description " AB1 "
> }
> ]
> }
> ]
> translation 6 12 0
>}
>
>
>I tried to access the
>field "diffuseColor", in other examples
>it seems to work, but in this case the
>code may be too complicated for this
>access. Does anybody know how to change
>color in this example?
>Thanks a lot.

You need to get access to the Material
node.
For example:

Dim eng As VRMLEngine
Dim transform As VRMLNode
Dim anchor As VRMLNode
Dim shape As VRMLNode
Dim appearance As VRMLNode
Dim material As VRMLNode
Dim color As SFColor

Set eng = Cortona1.Engine
Set transform = eng.Nodes("AB1").Fields
("children").Value(0)
Set anchor = transform.Fields
("children").Value(0)
Set shape = anchor.Fields
("children").Value(0)
Set appearance = shape.Fields
("appearance").Value
Set material = appearance.Fields
("material").Value
Set color = material.Fields
("diffuseColor")
color.Value = Array(0, 0, 1)

But the easiest way is to name the
Material node :-)


 


comlicated "fields"-usage / Martin Dolgner / 5.08.03 04:23
     Re: comlicated "fields"-usage / Mikhail / 22.08.03 04:59

Messages in thread: 2


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.