[Closed] i need help about ccCrurve
Hey Guys,
i have a ccCurve with only two Point Start + End. I want only copy as a integer the Y-Value when the X-Value is for example is 0.325. My Range for x is 0 – 1. I’m too stupid. Can every body help me.
mfg
hot chip
from MXS help
[left]getValue ccCurve <time_value> <float_x> [lookup:<false>][/left]
[left]Returns a Point2 value corresponding to the specified X position along the curve at the specified time.[/left]
getValue ccCurve 0f 0.325
Oh Sorry, it will not work,
the error message is: not “getValue” function for #(ccCurve : Reflection Curve)
my code:
…
global Glossy_Reflection_Curve
…
…
CurveControl cc_ReflSamples …
…
Glossy_Reflection_Curve = cc_ReflSamples.curves
…
…
… here come the error
zwerg_gloss_RefSamples = getValue Glossy_Reflection_Curve 0f mtl.refl_gloss
mfg
hot chip
in your code Glossy_Reflection_Curve is an array of cc curves…
you have to call
zwerg_gloss_RefSamples = getValue [color=yellow]Glossy_Reflection_Curve[[color=white]curve_id][/color] 0f mtl.refl_gloss[/color]
super that works now,
ähm little last problem ( i can run in the wall)
…
…
spinner ReflSamples pos:[128,498] width:40 height:16 range:[0,512,16] type:#integer
on ReflSamples changed val do ( max_glossy_Reflection_Samples = value )
…
…
max_Refl_Samples = max_glossy_Reflection_Samples
…
zwerg_gloss_ReflSamples = (getValue Glossy_Reflection_Curve[1] 0f mtl.refl_gloss)
…
… here come the error: Incompatible types: 0.210001, and SpinnerControl:ReflSamples
zwerg_gloss_ReflSamples= zwerg_gloss_ReflSamples * max_Refl_Samples
thank so much at your help.
spinner ReflSamples pos:[128,498] width:40 height:16 range:[0,512,16] type:#integer
on ReflSamples changed val do ( max_glossy_Reflection_Samples = val ) – not value!
zwerg_gloss_ReflSamples = (getValue Glossy_Reflection_Curve[1] 0f mtl.refl_gloss)
– it’s a point2
3)
zwerg_gloss_ReflSamples.value = (zwerg_gloss_ReflSamples * max_Refl_Samples).y