15,949,741 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Knight school (Top 49 by date)
Knight school
18-Feb-24 11:28am
View
Hi Gerry, Thanks again for getting back.
It does seem to be one of the major issues after check the results (i.e. the issue was the try catch erroring & therfore skipping the move. Obviously un noticable) but it has opened more questions.
1) I was having to add the moves in segment (i.e. a straight line split in to 100+ segments) to get it work & give feedback on current postion but now I have solution to the skipping I don't need to segment the move at all. The one thing I will loose is the current position but is there of getting this from the storyboard?
2) By increasing the move lengths & allow the storyboard to do it thing it can then be controlled better using the speed ratio & this should over come the 60fps restriction.
3) The do while is there for the feedback from the complete to say get the next move (& if I can overcome 1 & 2 I could run as whole story. Which will be possibly easier)
4) At the moment I have skip forward & back to key places in the story & as is it is easier as each move is tepped through but if I join them in to one. How will I do that?
Sorry to add to your support but as always the fix is not alway straight forward.
Many Thanks
Knight school
17-Feb-24 4:18am
View
Thanks again for the speedy reply, I have updated the question to include this is a 3D application using helix3D & is working with the exception of the duration control.
As far as I know (Still very much a novice) pointanimation is 2D.
I will see if I can break the code down more to help but its in 1000's of line (As I said novice & I'm sure it can be done in a handfull but it works at this point in time)
The points are LastPoint (XYZ) to NextPoint (XYZ) with rotation in XYZ (Something all or maybe just one).
Add more detail to the "tried" as I think you may be correct & it maybe for somewhere else & showing else where. I'm still not convinced it fixed but much better. Thanks
Knight school
16-Feb-24 11:48am
View
Hi, Thanks for the quick reply
The points (lastpoint & nextpoint) have been culled for no change but the moves are very small(<0.1) to acount for 3D spiral or arc moves. If I'm understanding you on the dependances the doubleAnimation is for X,Y,Z,Rot_X,Rot_Y & Rot_Z. The duration is based on line segment length. I think this is what you are refering to but please correct me if I'm wrong.
Once aian thanks again.
Knight school
3-Feb-24 10:16am
View
Thanks, I think the issues are linked to the Listview item. So I have got to this which is giving me a cursor change (I think this would be pointing to Drag started but I don't seem ti get to the drop.
Here is where I'm at:-
<listview x:name="Lst_File_Viewer" grid.row="2" grid.column="0" grid.columnspan="2" margin="5,3,5,3" selectionmode="Single">
<listview.itemcontainerstyle>
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<EventSetter Event="MouseMove" Handler="Lst_File_Viewer_MouseMove" />
<EventSetter Event="Drop" Handler="Lst_File_Viewer_Drop"/>
<listview.view>
<gridview allowscolumnreorder="False">
<gridviewcolumn header="File Name" width="Auto" displaymemberbinding="{Binding Name}">
<gridviewcolumn header="Dir" width="0" displaymemberbinding="{Binding Directory}">
Private Sub Lst_File_Viewer_Drop(sender As Object, e As DragEventArgs)
MessageBox.Show("Drop Happened")
'Not firing at all
End Sub
Private Sub Lst_File_Viewer_MouseMove(sender As Object, e As MouseEventArgs)
If e.LeftButton = MouseButtonState.Pressed Then
If e.Source IsNot Nothing Then
Dim myList As List(Of String) = New List(Of String)
For Each Item As File In Lst_File_Viewer.SelectedItems
myList.Add(Item.Directory)
Next
Dim dataObject As DataObject = New DataObject(myList)
DragDrop.DoDragDrop(Lst_File_Viewer, dataObject, DragDropEffects.Copy)
End If
End If
End Sub
Knight school
29-Dec-23 5:35am
View
Thanks, But how do I use this to tell which coin goes in which pot/Bag?
Knight school
29-Dec-23 5:34am
View
Sorry I'm unsure on what part you are refering to "Discarded".
Knight school
29-Dec-23 5:34am
View
I have updated the what I have tried to show where I am (Thanks for all the input).
Knight school
29-Dec-23 5:27am
View
I think so but I can't seem to convert to Vb to best read/understand it.
Knight school
28-Dec-23 11:26am
View
Yes, SM/N is optimal but not always achieveable. but how do we make process to get this to best based on the the values of the coins. Once again thanks.
My thoughts are now looking at targeting the optimal (SM/N) by largest to smallest. I'm still in the dark.
Knight school
28-Dec-23 11:15am
View
Adding to this I suppose the goal is to get the diffance between the highest pot value to the lowest pot value to be minimal. My intial thoughts were using the sum of all the coins / the number pot = optimal (Average) & then try to work from that. This is where I struggle to break it down. Sorry but I'm dead in the water with this one.
Knight school
28-Dec-23 10:50am
View
Again also me (Typo this time). Updated.
Another way to look at this is you have a bag of coins (differant values) & 4 pots. The output result is to fill in the pots with an ammount of coins (coins can only go in one pot & can't be copied) so that the total coin value in each pot in the lowest value accross the pots. There will in most cases be a variation between pot totals but if this kept to a miniumum.(i.e. on ex.2 varition of 100). If seen on a bar graph the bars should be the lowest average height. Does this help?
Knight school
28-Dec-23 10:21am
View
My mistake. Col2 corrected.
I will look at the examples but I'm unsure of the output as it is optermisation (Not realy something I can workout). Thanks again.
Knight school
28-Dec-23 10:01am
View
Hi,
Thanks for the reply, As I said it is difficult to explain. I Have updated the question. Hopefully helps
Knight school
27-Mar-23 12:10pm
View
Hi, Thanks for the reply. Its WPf & using Helix Toolkit. Sorry I should of been more specific.
Knight school
26-Mar-23 6:19am
View
I have update the Code but its difficault to break down to manageable size. I have managed to get a work around. I split the rotation & move into smaller pieces which can be animated in order. There for the user does not see the snapping. Not Ideal but work for now.
Knight school
13-Jun-20 13:26pm
View
Thanks. This solved the Time issue but the problem materailised as next move not waiting for the finish of the first/last move. I solved it with a DoEvent (or as sub dispatcher) which I think is using memory but works. The problem I have now is moving the Sphere was a test but I need to move a Modelvisual3D which was made up of a geometrymodel3D
Before I started with animation I used this to move it point to point but I can't work the code out for animation as it is for 2 differant thing.
What I used to do:-
Rev_Model_Tool1.Transform = New TranslateTransform3D(X, Y, Z)
Rev_Tool1.Content = Rev_Model_Tool1
And the DoEnvent I used to stall the next move
Do Until Move.GetCurrentTime.TotalMilliseconds >= TimeSpan.FromMilliseconds(Sim_Line_Time).TotalMilliseconds
DoEvents()
Loop
Public Sub DoEvents()
Dim frame As New DispatcherFrame()
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, New DispatcherOperationCallback(AddressOf ExitFrame), frame)
Dispatcher.PushFrame(frame)
End Sub
Can you give me any guide or direction (there is lots of rotaion example but nothing like this)?
Knight school
3-Dec-19 15:32pm
View
This must be beyond my understanding.
The Usercontrol needs to crete a RoutedEventArgs
So:-
Public Event CustomClick As RoutedEventHandler
With
RaiseEvent CustomClick(Me, New RoutedEventArgs())' to raise the event
And the the main form require Event to receive the event
main Form:-
Private Sub OnCustomButtonClick(ByVal sender As Object, ByVal e As Windows.RoutedEventArgs)
MsgBox("Got It")
End Sub
But nothing. Any pointers?
Knight school
28-Nov-19 15:16pm
View
Sorry for the delay in getting back (I have been away). Thanks for link when I am back I will look into it. Have you got a working snippet you would be able pass on (It may save me time & help me understand it better (WPF is a steep learning curve from Winform))?
Thanks
Knight school
26-Nov-19 15:01pm
View
Thanks.
That's a much clearer explanation of what I have been trying to understand from many days searching. The only question is how (possible some code as a pointer)?
Many Thanks
Knight school
25-Nov-19 15:24pm
View
Thanks,
I have no option as my self trained skills are based around Vb.net & I need the 3d capabilities of WPF (steep learning curve & which means c# which I have learnt over time to convert but not write). As for the article I had come across this on my travels but it did not seem to point to a solution or am I misunderstanding it?
Knight school
18-Jan-18 14:32pm
View
Thanks,
If I have understood you correctly the 3Dpoint class calculations are causing these errors & not the orbital mouse move. If this is correct how would the best direction to start to look at the formula?
Thanks for all your help.
Knight school
15-Jan-18 14:00pm
View
Hi,
Your solution works well but I must be missing something as when the rotation orbits around (approx. when the axis Z is pointing toward you) the axis is are inverted i.e. back to front. Would this be the 3Dpoint class calc's. I have heard there is a error due to some cases (sorry I can't find the detail or name again). Have you heard of this & better yet have you any work arounds?
Knight school
19-Dec-17 14:14pm
View
Sorry. I pasted the text straight out of VS & done some editing to try to make it clear.
Thanks for the links. I have not used Ultraedit so I will give it a go.
Knight school
26-Nov-17 12:22pm
View
Sorry for the delay in getting back. I have been try to put what I believe you have pointed out. This now moves the draw point (Offset) relative to the pivot point. I have also changed the Alt key to a number key selection (1 to 8) to change the pivot point. I hope this is what would stop the the spiral.
See updated Code in question
p.s.
I am very interested in the Painters algorithm & how to remove a cylinder from the cube. Maybe a new question.
Once again many thanks
Knight school
12-Nov-17 10:06am
View
What do you mean by spiral?
As for the methods (Alt key, Zoom & Pan) I only added them to you code to give you working representative model of what problem I was having.
The Alt Key is just to create a snap point & the Pan + Zoom is to make the app more usability (Stop the cube roaming off screen. It was only to help explain things (Which is difficult to put in words).
Knight school
11-Nov-17 12:47pm
View
See bottom of question.
Knight school
11-Nov-17 9:16am
View
I have managed to make my problem show up on you solution. I had to simulate a snap to point by using the Alt key & I have add zoom plus pan to better control of the cube space.
See attached Code.
i hope this is better to understand (Sorry I had to use WinForm).
Knight school
10-Nov-17 12:41pm
View
Sorry for the delay in replying & yet again not explaining myself properly.
My code is so far away from the the original post but what I am trying to do is pivot/rotate at a different position (i.e. The nearest of the cube corners to the Mouse down position). This should give the effect of a snap rotation & a more natural rotation with a more localized point of rotation.
My Code locates the pivot which is closest (This was easy) but when rotate point moves from one corner to another the cube shift due pivot point changes. I try to see if I can get you supplied solution to give this effect.
I hope this is a better explanation.
Knight school
31-Oct-17 15:15pm
View
Your solution was perfect & I accepted straight away but has course some effect (By design & not code) that I happened really thought off.
I am not using the code to just rotate a cube but thousands of point on graphics path which can large,complex & offset form zero point. So it is sometimes good to rotate the path relative to a point you can see when zoomed in. Than a point off screen which gives you a strange effect where the path rolls away from view.
I would understand if you were to say this is not what I asked for but you seem be someone who has an interest in this type of work & can point me in the right direction. I will still be trying to solves myself but if you have any ideas I would be forever grateful.
Knight school
30-Oct-17 16:06pm
View
Sorry for once again not explaining the problem.
You are correct I want to rotate around a point that is not the Origin/Center point (i.e. one of the corners - I already have a way of snapping to a point which I will rotate it from. I have also got it to rotate around that point (As you pointed out offset the point/vertices but when I do this it makes the cube jump with the snapped corner where the origin/center used to be. What I am aiming to do is spin/rotate relative to the snapped point but not make the model jump but just rotate.
My thinking (also trying) is to have smooth rotation relative to the snapped point. I have tried to change the translateMatrix1.Translate including the new shift but this is where it all goes wrong.I can't seem to get over this is just shift-rotate- shift back.
once again sorry to add to the original question.
Knight school
29-Oct-17 10:21am
View
Many thanks.
One question is still bugging me is how to change the rotation point.
I did think I should just move the points to make the rotation point on the origin but this causes errors (i.e. cube shifts). Then I tried to correct it by rotating a virtual point (Same XYZ shift as move) but this seems to go completely wrong.
Any ideas?
Sorry the question after a question.
Knight school
28-Oct-17 12:01pm
View
Sorry for the delay & many thanks for the solution. I have been away on holiday & I was on strict order no laptop & on top of that my PC has decided to have windows meltdown. I will be up & running soon & will test the update.
Many thanks (it was making me mad).
Knight school
21-Oct-17 5:51am
View
Hopefully the update is somewhere near the explanation you have supplied but as you will see there is still some strange after effect. I still trying to pin down the reason for the lock up & find out why the rotation is reversed but maybe down to the point you made the X turns into Z when rotated 90 degrees.
Getting there & maybe I should of asked for help along time ago but I was just going try to figure it for myself. maybe I should not tried for over a year.
If you have any more ideas to solve these issue just shout.
Many thanks
Knight school
9-Oct-17 14:15pm
View
I think I understand what you are explaining.
I can get the 2D angles (As viewed on screen after conversion) & direction from converting points let say 50 from the origin point. Then calculating the angle using Math.Atan2 but this is where I get a bit lost & how to convert to X-Z & X-Y. Sorry
Knight school
8-Oct-17 5:05am
View
I have tried the X move = X Rotation & Y move = Y rotation but it fall over when the model is in XY view.
I have had another thought but i may need some help with the math.
If you take the start point as well as the mouse move point & back calculate the 3D point back to axis. This would give you the appearance of moving the start point on screen as a roll. This may come up with more than one answer but we could filter this by closest angle previous.
Do you think this is a way that is possible or a long shot?
The bit that keeps me trying is that it must be possible as other application manage to do it.
Knight school
7-Oct-17 6:43am
View
Thanks for your comments. It is making it clearer in mind the problems I may be creating.
Could I determine the relative axis by which axis are pointing highest & lower direction. This way I will be altering only 2 axis which can controlled by mouse movement.
example:- If Z axis is pointing up most then the vertical roll would change & X axis is pointing down most then the horizontal roll should be used. Also the mid axis unaffected.
Would this work & give me the desired affect??
Knight school
6-Oct-17 13:59pm
View
Thanks. What happens if the axis are are already rotated (i.e. X= 45° Y =30° & the Z=5°). Will the roll/rotation be not relative to the true model because the axis is not aligned horizontal/vertical?
Knight school
4-Oct-17 14:59pm
View
Thank you for reading & replying. At least I am not going mad.
Knight school
10-Aug-17 9:36am
View
I need the curve to accurate as possible & not faceted but the points are for animation purposes. Points will not be a issue (Simple framerate) & will be equally spaced but the extra points added are not (maybe as you said just points on the spline).
The workaround seems to work without much processing power.
Thanks
For you time.
Knight school
10-Aug-17 8:38am
View
I have added a workaround by have 2 graphicspath (1 for draw -point count not important & 1 for point count & point positions which I have used a addlines which the point stay the same.
twice the amount of work but it does not slow down process.
I still would know why the extra points for the future?
Knight school
10-Aug-17 8:05am
View
I have added a count in the points to see if it adding the point more than once but it always comes back once.
I have tried
Colour_Path.AddCurve(Temp_Pts_Orig23.ToArray(), 0.0F, Temp_Pts_Orig23.Count - 1, 1.0F)
Which sets segments to the array count but always more points.
Knight school
10-Aug-17 7:45am
View
Sorry for not being clearer in explanation.
The array is not running in more than once that I can see.
The method (For each) is called as Array of deciphered text into individual data of which this method cycles through & gives me list of points (which are points on a 3D curve). The cycle is then converted to 2D points to draw on screen(which can also be rotated in 3D (mouse move with left click).
The reason for having individual graphicspaths they can traced back to the original code position.
I hope this helps (I am not used to using a forum as I normally find an answer in the net but after searching for days no one seems to of come across this problem)
Knight school
10-Aug-17 6:06am
View
Hi,
The Point3D converts X,Y,Z points to 2D points so it can displayed on screen. Which works very well & the point count is OK (32 points in & 32 points out). The problem really lies when add the array to the graphicspath (add curve only). I add 32 points & when I do graphicspath data point count it is 93. So when I want to use a tandem array with other info which is no points (color etc.)the counts get out of sync.
I hope this helps understand the problem I am having.
Knight school
9-Aug-17 3:40am
View
Sorry I should of added more detail.
Dim Temp_Pts_Orig23 As New List(Of PointF)
Knight school
20-Dec-15 7:18am
View
Thanks I try it tomorrow at work.
I was looking for a programmable result, but this will do.
Knight school
5-Jul-15 12:26pm
View
I have decompiled the file & fixed the problem (Not checking if connection to database was open). Thanks you for all you help. I will have use this more often.
Knight school
20-Jun-15 13:54pm
View
I see the point (At last). I have never tried to decompile a file before but I will give it a go on Monday. Thanks for the new direction.
Knight school
16-Jun-15 15:01pm
View
Thanks for you comments,
Its a .net console application written for our company by an outside programmer (Before my time) & they are not willing to supply to source code so I can fix this oversight (possibly a try catch with a simple timer). The application collect data from there software to pass it to another piece of software (Some database & some app data). To re-write this would be difficult & time consuming & they would not be willing to pass all the info over. So this would be simpler to restart the crashed software but is not showing as non responsive. I am assuming that Windows 7 is see thing a bit differently. I have little or no luck getting the server boys to look at the server issue (Software & process to small to spend their time on).
We could pay the original programmer even more money to revisit what he did not do well last time. but good money to bad is in my opinion a good thing.
Knight school
10-Apr-15 13:21pm
View
Thanks,
I am running picturebox on panel of a SplitContainer. Don't think I can draw direct on the panel. The other reasons for picturebox was I can pan/Zoom (i.e. Move/ resize picturebox). This is only way I know how to zoom without transform & redraw (time consuming). I would normally use the paint event but the drawing requires thousand of calcs for all the point and drawing (which refresh would be a draw, but a draw to image would save all drawn detail). I hope this explain so it is understandable & I really don't know if it is the correct way (Still learning & still making a lot of mistakes)
Show More