Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Add Chart3D and Pie3D behavior RotateModel (Read 4257 times)
abrechts
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: May 30th, 2016
Add Chart3D and Pie3D behavior RotateModel
Jun 7th, 2016 at 11:04am
Print Post  
Currently the perspective of the 3D models only can be changed by rotating the *camera* around the model by applying Behavior3D.ChangePerspective. This has the disadvantage that when examining the model in space one will invariably end up in dark and shadowy areas of it, since the light sources don't rotate along, which is less than ideal.

The more optimal behavior would be to rotate the *model* instead, which always keeps the light sources at the same angle to camera and model, and thus provides consistent illumination. Therefore the implementation of an additional behavior enumeration e.g. called Behavior3D.RotateModel could vastly improve the user experience.
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3204
Joined: Oct 19th, 2005
Re: Add Chart3D and Pie3D behavior RotateModel
Reply #1 - Jun 7th, 2016 at 11:24am
Print Post  
Hi,

Lights follow the camera by default so you should see model's shiny side projected, and that's what I'm seeing in the sample projects. Maybe check if you haven't added a Light instance to the Chart3D.StaticLights collection - those do not follow the camera but stay fixed in the scene.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
abrechts
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: May 30th, 2016
Re: Add Chart3D and Pie3D behavior RotateModel
Reply #2 - Jun 7th, 2016 at 12:15pm
Print Post  
You are right - I actually did have some static lights applied. I added them because the Chart3D model gets over-proportionally dark when viewing a surface from less than a 45C angle, but still fully in light direction. Is there a way to ease this effect a bit, towards a less high-contrast image result?
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3204
Joined: Oct 19th, 2005
Re: Add Chart3D and Pie3D behavior RotateModel
Reply #3 - Jun 7th, 2016 at 2:02pm
Print Post  
Try adding more lights to soften shadows, either a DirectionalLight pointing down or a PointLight, e.g. we add a second light in SurfaceChart example exactly for that purpose -

Code
Select All
DirectionalLight light = new DirectionalLight()
{
    Color = Colors.White,
    Direction = new Vector3D(-1, 3, -1),
};
surfaceChart.StaticLights.Add(light); 



You could add it to Lights collection instead to make it keep its relative position to camera.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
abrechts
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: May 30th, 2016
Re: Add Chart3D and Pie3D behavior RotateModel
Reply #4 - Jun 8th, 2016 at 12:34pm
Print Post  
I've found that the addition of an AmbientLight does the trick to ease the contrasts. Following light combination currently works pretty well for my stacked 3D chart with cylinders, maybe it also helps someone else (vb.net):

with myChart3D
.Lights.Clear()
.StaticLights.Clear()
.StaticLights.Add(New AmbientLight(Color.FromRgb(110, 110, 110)))

Dim light = New DirectionalLight()
With light
.Color = Color.FromRgb(155, 155, 155)
.Direction = New Vector3D(-1, -1, -2)
End With
.StaticLights.Add(light)
end with
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint