Click Event through transparent surface using Helixtoolkit.SortingVisual3D - wpf

I want my clickable blue cube to change a color while I click on it through transparent surface MeshGeometryVisual3D element. When the cube container is a children of the ViewPort class everything works fine but is not visible through the surface (no sorting), but when it is children of Helixtoolkit.SortingVisual3D the click event stops to work but is visible through the surface!
This is the code of SortingVisual3D elements what I use:
<helix:SortingVisual3D x:Name="sortingVisual1" Method="BoundingSphereSurface" SortingFrequency="5" >
<helix:MeshGeometryVisual3D x:Name="_visual" MeshGeometry="{Binding objectGeometry}" Visible="{Binding IsChecked, ElementName=MeshVisible}" >
</helix:MeshGeometryVisual3D>
</helix:SortingVisual3D>
The code of the cube adding to SortingVisual3D element is this:
AddCubePoint cpsorting = new AddCubePoint(middle, defaultMaterial);
sortingVisual1.Children.Add(cpsorting);
I have tried to use two identical cubes (one child of ViewPort, the second of SortingVisual3D) at the same position, but the color changes on clicking behind the surface, only on children of ViewPort (see the picture)!
I am new to helix-3d-toolkit and after 2 days research I couldn't find any workable solution or idea how to solve this problem ! Please, help me !

You need to put the cube before your semi transparent mesh, so the cube is rendered first. Set your transparent mesh hit test visible to false

Related

Creating a custom shaped border

I need to create a border with some kind of arrow in its edge. This is the picture -
And I need to be able to move this arrow (it points the selected item in a listbox outside the border).
Thanks.
What I have done is to put this triangle as an image in the ListBox (left to the border), and I'm showing it only on the selected item (with DataBinding).
Not to "stright", but works great (after I was sure I wouldn't be able to do that).

Image glimmer or sparkle animation

I've been searching for awhile, but haven't been able to find anything. I'd like to be able to add kind of a glimmer or sparkly animation on an image element in wpf.
Essentially the effect here I'm after here is the same that you get with trading cards that are "foil's".
I'd like to have an image, and then be able to add this animation to it at will. I'm thinking maybe some kind of user control, or template possibly. Hopefully generic enough that I can just toss an image at it and it will just overlay the image and run.
Any ideas?
A simple construction that easily can be turned into a control is by nesting the image in a Grid and adding a second Grid (on top) as a sibling.
De second grid can be given a linear gradient brush that is primarily transparent but does contain a white glimmer.
This brush can be animated; you could move it and change the opacity of the grid/brush.
This way you do not change the image.

How to display a background control in transparent overlapping control?

I'm building a form with two layers of controls. The bottom layer is a set of Panels with defined properties, one of which is a color different from the form background. The top layer is a set of picture boxes I'm using to display a circle. I've set the PictureBox Background to Color.Transparent, and I've offset it from the underlying Panel by one pixel to get the form to draw the underlying Panel. However, the area around the circle in the PictureBox is displaying the Form Background color, not the panel color. I don't want to draw the circle in the Panel, because I want the circles to move between Panels, and actually look like just a circle that's floating across the form independent of the Panel board underneath. Think of the effect as moving a piece on a board game (you see the peg move across the board, possibly on a diagonal not following the normal game path, then stop in a place on the game).
How can I get the PictureBox to have the underlying Form and panels show through, not just the form background color? I'm using C# Visual Studio 2010, and I'm not a terribly experienced programmer, so a code example would be helpful. An image of the form is at:
http://www.imageurlhost.com/images/salgmpcxvcz830c3flt.jpg
Found a way around the problem. I got rid of the Panels for the spaces in the game, and instead drew them as rectangles on the form's background image.

How can I animate a transition when moving a child from one panel to another in Silverlight

I would like to animate a transition when moving content between two panels. I am getting a bit map image of a detail record and docking it as a thumbnail in the panel below. The docking area is in a footer grid and the content detail is in another grid that sits above the dock area (the dock and the main content area live in separate rows of the root layout control - another grid).
I have tried implementing this with a ScaleTransform and a TranslateTransform, simultaneously shrinking the image and moving it towards the footer control. When it moves into the footer control, it gets clipped even though the image Canvas.ZIndex property is set to a very high number. Eventually the thumnbail will need to be a child of a StackPanel that sits inside the footer grid.
Thanks for your consideration and help.
I had a similar problem (clipping) with a WPF animation I had. The problem was that the owner of the animation needed to be a parent of both containers for the animation to work (in my case I made it the actual window holding the containers).
Without any code, I can't see if that is your problem, but I thought I would throw it out there.
You can see my code where I animate moving from one container to another here:
http://wiassistant.codeplex.com/sourcecontrol/changeset/view/36638?projectName=WIAssistant#924851
(See the AnimatePaneBox method at the bottom of the file.) This may or may not be useful to you.
I've done something similar by creating a Canvas that sits over the top of both containers, using a WritableBitmap (if necessary) to create a rendering of the object that you're moving and attach it to that Canvas, animate the bitmap (translate, scale, opacity, whatever), and then pop the new object in under it at the end of the animation. It can be brittle if your controls need to be able to move or resize, but in most of my circumstances it's been a reliable hack.

Silverlight magnify contents of one canvas and show zoom contents in another canvas

I have a Silverlight app with a canvas with some ellipes in it. I have another canvas below it with no elements.
What I want to do is, when I click in the first cancas, I want to copy the contents of the first canvas and zoom in where I clicked my mouse and show it in the second canvas.
I want functionality like Local Connection gives you in silverlight 3 but as the canvases are in the same xaml and app it would be overkill to use Local Connection.
My solution is really simple I'm almost embarrassed.
I have set the properties of my second canvas to match my first canvas and duplicated any static elements that wont change (I plan to try pull these from one xaml file)
When I click the first canvas I add a new ellipse at the point where I clicked. In the same function I create another ellipse element and add it to my second canvas.
cnvSource.Children.Add(ellipseElement);
cnvTarget.Children.Add(ellipseElementCopy);
I can then create a zoom function on my second canvas so that the first canvas is unafected.

Resources