Hi,
How can we turn the light off and on in 3D drawings in Android studio?
Best regards…
- MUSTAFA KELSAKA asked 4 years ago
- You must login to post comments
Hi Mustafa,
I’m afraid we don’t fully support controlling lighting for 3D chart for now. We have partial support for surface mesh series where you can set LightingFactor.
May I ask what you’re trying to achieve?
Best regards,
Yura
- Yura Khariton answered 4 years ago
- You must login to post comments
Hi Yura, thanks for answer. I try the code below but it didn’t work. Do you think there is an error in my code? If there is no error, I will search diffrent solutions.
float lightValue = 0.1f;
|
|
|
ContourMeshRenderableSeries3DBase contourMeshRenderableSeries3DBase = new FreeSurfaceRenderableSeries3D();
|
|
|
btnLightTest.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
contourMeshRenderableSeries3DBase.setLightingFactor(lightValue);
lightValue = lightValue +0.1f;
if(lightValue>1) lightValue=0.1f;
}
});
- MUSTAFA KELSAKA answered 4 years ago
- last edited 4 years ago
- You must login to post comments
Hi Mustafa,
May I ask what the problem is? I’ve tried to add similar code into our demo application and it worked. I’ve used this example as base, added button with this callback:
binding.button.setOnClickListener(new View.OnClickListener() {
float lightingFactor = 0f;
@Override
public void onClick(View v) {
rs0.setLightingFactor(lightingFactor);
rs1.setLightingFactor(lightingFactor);
rs2.setLightingFactor(lightingFactor);
lightingFactor += 0.1f;
if (lightingFactor > 1f)
lightingFactor = 0f;
}
});
You can see results on attached images.
Best regards,
Yura
- Yura Khariton answered 4 years ago
- You must login to post comments
@Yura thanks for answer. I am not interested in the project right now. Therefore, I could not return to you. Thank you for taking care of my question.
- MUSTAFA KELSAKA answered 4 years ago
- You must login to post comments
Please login first to submit.