0

Line are invisible for AddBoundingBox with opacity

Niteen 10 years ago updated by Lucas Silva 10 years ago 7
We have create the model in helix3Dviewport and added AddBoundingBox into this view port.
my issues is when i zoom-in and zoom-out the model the AddBoundingBox lines are not displayed completely , it is displayed in dotted lines .
we have user the AddBoundingBox function with parameter rect3D and opacity is 2.

here is my code..

Private Function CreateDice(ByVal rect3D As Rect3D, ByVal brush As Brush) As ModelVisual3D
Dim diceMesh = New MeshBuilder() diceMesh.AddBoundingBox(rect3D, 2)
Dim GeometryModel3D = New GeometryModel3D()
GeometryModel3D.Geometry = diceMesh.ToMesh(True)
GeometryModel3D.Material = MaterialHelper.CreateMaterial(brush)
Dim ModelVisual3D = New ModelVisual3D()
ModelVisual3D.Content = GeometryModel3D
Return ModelVisual3D

End Function


how to resolve this lines issue..

Hi, I think that you forgot BackMaterial Property

Add this line in your code

GeometryModel3D.BackMaterial = MaterialHelper.CreateMaterial(brush)
The my lines issues not resolve even use the BackMaterial . Please see attache screen shot.




my another concern is, we have added the 2000 and more object in view port and because of this our model is running slow. When we try to rotate the model , it will move very slowly..

can you suggest, how to improve the performance to running fast and easy?

Thank you for your reply,

my another concern is, we have added the 2000 and more object in view port and because of this our model is running slow. When we try to rotate the model , it will move very slowly..

can you suggest, how to improve the performance to running fast and easy?
You are using PNG image? Because the helix is not good with png transparency
This is not the image this is a drawing, we are drawing the rectangle with diameter 3.0 and render it on viewport and they are display like this (image).

Is there any way to create the rectangle with fill color and border line to different color for same object? because currently we have added the AddBox() and this add box not supported to show the border lines. So to achieve this we are creating the another AddBoundingBox() with diameter 3.0 and replace this object to AddBox(). So for one rectangle we create another rectangle to display the border lines.

My requirement is to draw the single rectangle with border line but rectangle fill color and border color will different.

I hope u understand. please reply if not clear.

Thanks,




This is my requirement - To draw rectangle with border and Fill its different color . Please find the attached screen shot that contains nine rectangle with different color.




Please help me, How to draw single rectangle object with border line and fill with different color.


You can use this:

'All borders are a global variable because have the same Material
Dim border As New LinesVisual3D

Public Sub addRectangles()
addRectangleWithBorder(New Point3D(0, 0, 0), 10, 5)
helix.Children.Add(border)
End Sub

Sub addRectangleWithBorder(ByVal position As Point3D, ByVal width As Double, ByVal Lenght As Double)
Dim rectangle As New RectangleVisual3D

rectangle.Length = Lenght
rectangle.Width = width
rectangle.Origin = New Point3D(0, 0, 0)
rectangle.Material = Materials.Red
rectangle.BackMaterial = Materials.Red

Dim p1, p2, p3, p4 As Point3D

p1 = New Point3D(Lenght / 2, width / 2, 0)
p2 = New Point3D(Lenght / 2, -width / 2, 0)
p3 = New Point3D(-Lenght / 2, -width / 2, 0)
p4 = New Point3D(-Lenght / 2, width / 2, 0)

With border
.Thickness = 2
'Base
.Points.Add(p1)
.Points.Add(p2)

.Points.Add(p2)
.Points.Add(p3)

.Points.Add(p3)
.Points.Add(p4)

.Points.Add(p1)
.Points.Add(p4)

.Color = Colors.Black
End With

helix.Children.Add(rectangle)
End Sub