ParallelGraphics Forums
SDK
You are here:
[Forums]
::
[General]
::
[SDK]
All forums
How to use forums
Favorites
Services
Registration
Registration
Forgot your password?
Help
Help
Support
Quick search
Subscribe to newsletters
email:
password:
 
General
-
SDK
[reply]
[back to forum]
[new message]
[all forums]
Subject:
Changing color using diffuseColor
Sender:
yahayauk@yahoo.co.uk
29.12.07 23:23
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
[reply]
[back to forum]
[new message]
[all forums]
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
[reply]
[back to forum]
[new message]
[all forums]
© 1998-2007
ParallelGraphics
. All rights reserved.
Terms of use
.