Possible Charged Particle Field

Page 19 of 23 Previous  1 ... 11 ... 18, 19, 20, 21, 22, 23  Next

Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 6:53 pm

You don't add code to the addLinearMarker function, you call it with the node you want to add as a linear marker. You can call it as many times as you want, passing in different marker nodes to be added.

The reason you aren't seeing the marker is because the addLinearMarker method is not being called by anything. It is there for you to call, the system has no need to call it.

Code:

module.Particle.prototype.createNode = function( ... )
{
  ... // existing code
  
  this.armillaryNode = ... // create marker node
  // then add it to the markers, not to the grp parameter
  this.addLinearMarker( this.armillaryNode );
};

All of the code you put into addLinearMarker should be put into a new method called something like createArmillaryOverlay, which returns the created node. You then call that createArmillaryOverlay method from createNode, store it in a member variable (this.myVariable = ...)  and then call the addLinearMarker method to add them.

Code:

module.Particle.prototype.createNode = function( ... )
{
  ... // existing code
  
  this.armillaryNode = this.createArmillaryOverlay(); // create marker node
  // then add it to the markers, not to the grp parameter
  this.addLinearMarker( this.armillaryNode );
};

module.Particle.prototype.createArmillaryOverlay = function()
{
  var marker = new THREE.Group();
  ... // add nodes to marker group
  // this is where your code currently in addLinearMarker is added
  return marker;
};

If you have 2 types of armillary markers, then create 2 methods, one for each. See if you can do it in 1 though, but only if it makes sense. If they are not connected to each other, then create separate methods, but if they are related, then just do it in the 1 method. If my understanding is correct, then there are only 3 rings that are part of the armillary, and the other things you want to add a velocity markers, not armillaries. These should be separate methods as they are not related to each other.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Mon Oct 29, 2018 8:47 pm

.
Golly, I feel pretty dumb, it will take some time and effort to correct my thinking. By the way, those 2 armillary markers are the same, I gave them two different names in order to help me indicate the 'node' source - for troubleshooting my difficulties. Fat lot of good that did, I had no idea I was completely misunderstanding the functions and screwing up addLinearMarker.

Trying to wend my way backward through the changes I made I see I'm in a thicket. It's not pretty.

Please, if you'll be so kind, I beg you. Reject, reverse, undo or cancel my latest Commit changes in cdm.js and test.html and Push it back. That's the only way I think I'll be able to return to normal. The colliding - Spin 01 changes are OK, but I'll be happy to change them again if it's easier for you to just delete my last Push.  
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 10:00 pm

Don't feel bad. I'm probably not explaining things clearly enough. It is easy to speak in terms that other developers will understand immediately, but I have to remember that you might not understand them as intimately as I do. It happens to me sometimes at work too. Trying to work in somebody else's code base can be difficult and what seems obvious to the author, is not always obvious to others. No matter how proficient they are.

I don't think I actually explained what to do with the add*Marker methods. I just expected you to know already. Not intentionally, but that doesn't change the outcome.

I can't rollback that commit until I get home. Probably about 3-4 hours from now. I tried to do it through the website, but it doesn't let me do that sort of thing, unfortunately.

Here's what you can do. Open SourceTree and look at the commit graph. You should see your latest commit at the top and my last commit, from 2 days ago, underneath that. Left click on my commit so that it is selected. Now right-click on it to show the popup menu. Then click on the menu item 'Reset current branch to this commit'. That will rollback all commits above the one that is selected.

That should leave you with my commit at the top of the graph. If that is what you see, then you can push those changes and it will remove your commit from the server too.

After that, click on my last commit again and then press the Branch button to create a new one that you can work in safely.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Mon Oct 29, 2018 10:31 pm

.

Given a choice and your directions, I couldn't wait, maybe I should have.

I followed your instructions, up to 'Reset current branch to this commit'. You said  "That will rollback all commits above the one that is selected". The screen doesn't seem to match your statement. I see a Pull is due, where did that come from? The uncommitted changes at the top, they are the no-longer-commits I want to get rid of from my last push.

What next boss?
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 10:45 pm

It shows that a Pull is available because that is the commit you just rolled back. If you did pull that down, you would be back in your original position. So don't do that.

The next step could be tricky. Not difficult, but I'm not sure if you have the permission to do it, but let's give it a try.

Click the Push button and unselect all branches. Then select the master branch. It was probably already like that but I just want to make sure.

Now, at the bottom of the Push dialog box, you will see some checkboxes. Make sure that Force Push is selected and then press the Push button.

That will re-write the commit history on the GIT server. Effectively removing your last commit.

Don't worry about the warning SourceTree will show you when you try to force push. It can be a dangerous operation if other developers have those changes pulled to their own repository. I don't have them so you can safely force push.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Mon Oct 29, 2018 10:53 pm

.
One question. Please confirm that the master branch I should be on when I try to Force Push, is the red master associated with your commit, Fixed the SpatialIndex ... , (and not the blue origin/master just above it).
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 11:07 pm

The red one represents your local repository, the blue one the server. But it doesn't matter. It doesn't care what you have selected, just what you have committed.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 11:08 pm

Note that the colors are not set in stone. Red does not always represent you and blue does not always represent the server. It just happens to in this case.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Mon Oct 29, 2018 11:19 pm

.

I wasn't allowed the Forced Push alternative, the box wouldn't take my check mark. The Push didn't work - for the old reasons. My screen remains the same. Should I go to terminal node - while on the master line - and try to Push from there?
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 11:26 pm

No, you have to tell SourceTree that you want to be able to do Force Pushes.

Got to SourceTree -> Tools -> Options -> Git.

On that tab, you will see a checkbox about half way down the page that says Enable Force Push. Make sure that it checked and then try to force push again.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Mon Oct 29, 2018 11:34 pm

.
I changed my Force rights. I was able to select the Force Push, but the operation failed. The result was the exact same error message as my last post.
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 11:45 pm

That is the same issue you were having a while ago. I think this is a SourceTree problem, not a GIT problem. You can try the command line if you feel up to it.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Mon Oct 29, 2018 11:52 pm

.

Rejected. Suggesting I Pull before Pushing.
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Mon Oct 29, 2018 11:55 pm

That's why you have to force push. I don't know the command line but just search for it on the web.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Tue Oct 30, 2018 12:08 am

.

git push --force. The terminal Forced Push worked. Hallelujah.

What's the best way to get rid of my changes? Just discard them?
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Tue Oct 30, 2018 12:43 am

Yes, just select them discard changes.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Tue Oct 30, 2018 12:45 am

OR

You can select the top commit that you want to go back to, right-click and select revert to this commit. When that opens a dialog box, select Hard revert and it will delete all changes.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Tue Oct 30, 2018 10:30 am

.
Thanks for a good night's sleep. I'll get back to work.
.

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Tue Oct 30, 2018 5:52 pm

I had a look at the latest commit and it is set out correctly, but there are some small issues that can be addressed.

Code:

 module.Particle.prototype.createUniverseAxesOverlay  = function()
 {
 this.universeAxes = new THREE.Group();
 var aRadius = 1.2*PIM.RADIUS;

In this method, you are creating a new THREE.Group to contain all of the universe axes. That is good, but you don't want to set it as a property on this in this method.

You are calling that method in createNode and setting it to a different property:

Code:

this.armillaryNode = this.createUniverseAxesOverlay();

So in the end, you have the same object stored under 2 different names. While that will work, it is not the way it should be. Just change the assignment to a local variable in createUniverseAxesOverlay:

Code:

 module.Particle.prototype.createUniverseAxesOverlay  = function()
 {
 var universeAxes = new THREE.Group();
 var aRadius = 1.2*PIM.RADIUS;

Secondly, you are referring to the PIM module from within the PIM module. You should not reference it as PIM from within its own source code. It should be referenced as module. They are the same exact object, but you can't rely on PIM being set until after this code has been interpreted.

In this case it will work because you are referencing PIM from within a function that is only called after the module has been interpreted, but that may not always be the case. You can't rely on it all of the time, but you can rely on the module variable, because it is a local variable that is later set to the PIM global variable.

You have been working within the scenarios where PIM is already defined and that is how you should access it. Working in cdm.js is a bit different.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Tue Oct 30, 2018 6:58 pm

.
First things first. Thanks again for your patience, explanations, expertise, ... , and the do-over.


The Universe axes are there to be selected on their own, as valid a particle marker as the particle axes. It can be added to the graphics list. The same, I hope, will be true for velocity and spin vectors. The user may wish to see velocity and/or spin vectors without all the bells and whistles of the armillary.

To-do:
b. Spin axis.
c. Spin equator.
d. Velocity vector.
e. Spin vector.

The Plan. As I believe you’ve mentioned, lines that can change directions must be added to the rotational group. I suppose I’ll be creating additional modules for these items, their products will be added to the rotational group before being added to the armillary. That’s the plan.

So in the end, you have the same object stored under 2 different names. While that will work, it is not the way it should be. Just change the assignment to a local variable in createUniverseAxesOverlay
As usual, I need to give it some thought. True, I begin the armillary as a universeAxes, but I expect I'll be adding the four additional rotational products to the armillary as well. Does that change your interpretation/advice for correction? I'll clean-up the PIM reference next.

////////////////

P.S.
Correction. I misspoke. As you clearly stated, and I completely agree, the velocity and spin vectors will Not rotate. The spin axis and equator can rotate but they shouldn't. (How are things kept up to date?) I have no problems speaking in rash generalities, it's the details that get me in trouble.
.


Last edited by LongtimeAirman on Tue Oct 30, 2018 7:55 pm; edited 1 time in total (Reason for editing : Added P.S.)

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Tue Oct 30, 2018 8:02 pm

I don't think you will want any of these to be rotating with the particle. Certainly not the velocity vectors. The b, c, d and e in your todo list should not be added to the armillary. They are separate markers of their own and should be treated just like you have the armillary. b and c can be put into the same marker, because they are 2 aspects of the same thing. You will need to keep the linear and spin velocities separate as well because they both need to be updated.

So you should end up with 4 markers: armillary, spin axis (which includes the equator), spin velocity and linear velocity.

I think that the spin axis and spin velocity can be put into the same marker eventually, but not yet. Once we have a better way to render the spin velocity, the spin axis marker will become redundant.

No, that doesn't change my interpretation/advice. No object should be referenced from the same place with different names (without some very good reason and we don't have one here).
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Tue Oct 30, 2018 8:04 pm

You could put the spin axis (and equator) into the spin velocity marker and then connect the spin velocity vector to the equator ring.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Tue Oct 30, 2018 9:00 pm

avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Wed Oct 31, 2018 1:06 pm

.
I'm stuck in the Velocity Vector overlay module. It looks simple, but after two hours effort I can justify asking for your helpful comment. Extra lines were added over time. I know the rest of the code works correctly when I push the dummy vertex line endpoint instead.

Code:

module.Particle.prototype.createVelocityVectorOverlay  = function()
{
      var cVel = new THREE.Vector3();
      this.velocityVector = new THREE.Group();
      // this.velocityVector = new THREE.Vector3();
      var velocityVectorGeometry = new THREE.Geometry();
      var scalarM = 1000; // Multiplying the velocity by an estimated
      // time.delta as is done in module.update below.
      // cVel.copy( this.velocity ).multiplyScalar( scalarM );
      cVel.copy( this.velocity );
      cVel.multiplyScalar( scalarM );
      velocityVectorGeometry.vertices.push(
           new THREE.Vector3( 0, 0, 0 ),
           new THREE.Vector3( cVel.x, cVel.y, cVel.z ));// Not Working.
           //new THREE.Vector3( 3, 3, 3 ));// This dummy velocity distance works.
      var velMat = new THREE.Line( velocityVectorGeometry, MAT_LINE_CP );
      this.velocityVector.add(velMat);
      return ( this.velocityVector );
};

LongtimeAirman
Admin

Posts : 1044
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Wed Oct 31, 2018 4:07 pm

There is probably nothing wrong with it, the current velocity may just be zero.

The more important code is in the update method, as that will alter what you setup here before you ever see it on screen.
avatar
Nevyn
Admin

Posts : 1360
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Sponsored content


Sponsored content


Back to top Go down

Page 19 of 23 Previous  1 ... 11 ... 18, 19, 20, 21, 22, 23  Next

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum