ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

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:
   General - SDK

Subject: Re: Changing color using diffuseColor
Sender: yahayauk@yahoo.co.uk 3.03.08 21:16
Hi Some-1,

I got around that! Try the following to assign/change the values for diffuseColor field material.Fields("diffuseColor").red = 0
material.Fields("diffuseColor").green = 1
material.Fields("diffuseColor").blue = 0.5

Yahaya

Hi Yahaya - I have been trying to do the same. I wonder if you got your code working. I'd love to exchange any useful information together.
Thanks - some-1

Hi there, I am just a beginner and am trying to change the color of a shape by clicking on it on the scene. I have the following vb.net code in the AxCortona2_ClickEvent:
Dim localmouseposition As Point
Dim Engine As VRMLAutomation.VRMLEngin
Dim chain As VRMLAutomation.MFNode
Dim shape As VRMLAutomation.VRMLNode
Dim appearance As VRMLAutomation.VRMLNode
Dim material As VRMLAutomation.VRMLNode
Dim materialcolour, tempcolor As VRMLAutomation.VRMLField


Engine = AxCortona2.Engine
localmouseposition = AxCortona2.PointToClient(Windows.Forms.Cursor.Position)
chain = Engine.Pick(localmouseposition.X, localmouseposition.Y)
    If chain.Count = 0 Then
    Exit Sub
    End If
    shape = chain(chain.Count - 1)
    appearance = shape.Fields("appearance").Value
    material = appearance.Fields("material").value
    
materialcolour = material.Fields("diffuseColor").value
    tempcolor = Engine.CreateField("SFColor")
    tempcolor.Red = 0
    tempcolor.Blue = 0
    tempcolor.Green = 1
    materialcolour.value = tempcolor.value

Nothing happens when I run the code. The program seems to exit the sub once it encounters the 'materialcour ='expression. Could someone pls helpout?
Cheers.
Yahaya


 


Changing color using diffuseColor / yahayauk@yahoo.co.uk / 29.12.07 23:23
     Re: Changing color using diffuseColor / some-1-2@hotmail.com / 3.03.08 15:07
         Re: Changing color using diffuseColor / yahayauk@yahoo.co.uk / 3.03.08 21:16
             Re: Changing color using diffuseColor / some-1-2@hotmail.com / 4.03.08 03:39

Messages in thread: 4


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