Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍰 Michelson-Morley-Experiment-3D.html - Tryout Next Step #9

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 70 additions & 35 deletions _Test/FrQFT JS Animations/Michelson-Morley-Experiment-3D.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h2 id="headline"></h2>
) / 2
// add a radius to be in the center of the bottom split
+ laserCylinderGeometryParamsObj.radiusTop
const laserSlpitsPositionDistance =
const laserSlpitsPositionDistance =
laserCylinderGeometryParamsObj.radiusTop * 2
+ laserSlpitsSeparationDistance

Expand Down Expand Up @@ -407,13 +407,16 @@ <h2 id="headline"></h2>
armStarWaysEnums.inScreen,
]
const endlessTimeLength = -1.0
const compressedWayLength = -1.0

/*--------
Scene Basics */

const laserAnimated = true
const laserAnimated = false
const laserSlpitsSeparated = true
const logArmStarData = false
const logArmStarData = true
const logLaserSplitIndex = 2
const logArmStarIndex = 0

const centerHeightPosition = plateHeight / 2

Expand Down Expand Up @@ -482,8 +485,11 @@ <h2 id="headline"></h2>
// name: added below for all
arm: z,
directionToCoord: backward,
startPos: end[z] + laserBeamLength / 2 + laserPartLength,
wayLength: laserPartLength, // Wolle
startPos: end[z] + laserPartLength,
// wayLength: laserPartLength, // Wolle
// wayLength: compressedWayLength, // Wolle
wayLength: 0.0, // Wolle
pseudoWayLength: laserBeamLength, // Wolle
// velocity: 0.0, // Wolle
velocity: velocity.obs.z, // Wolle
// timeLength: added below for all
Expand All @@ -494,55 +500,63 @@ <h2 id="headline"></h2>
directionToCoord: backward,
startPos: end[z] + laserPartLength,
wayLength: laserPartLength,
pseudoWayLength: null,
velocity: velocity.obs.z,
},
[armStarWaysEnums.sourceToHalfMirror]: {
arm: z,
directionToCoord: backward,
startPos: end[z],
wayLength: centerDistance.obs.z,
pseudoWayLength: null,
velocity: velocity.obs.z,
},
[armStarWaysEnums.halfMirrorToMainMirror]: {
arm: z,
directionToCoord: backward,
startPos: middle,
wayLength: centerDistance.obs.z,
pseudoWayLength: null,
velocity: velocity.obs.z,
},
[armStarWaysEnums.halfMirrorToSideMirror]: {
arm: x,
directionToCoord: forward,
startPos: middle,
wayLength: centerDistance.obs.x,
pseudoWayLength: null,
velocity: velocity.obs.x,
},
[armStarWaysEnums.halfMirrorToScreen]: {
arm: x,
directionToCoord: backward,
startPos: middle,
wayLength: centerDistance.obs.x,
pseudoWayLength: null,
velocity: velocity.obs.x,
},
[armStarWaysEnums.halfMirrorToSource]: {
arm: z,
directionToCoord: forward,
startPos: middle,
wayLength: centerDistance.obs.z,
pseudoWayLength: null,
velocity: velocity.obs.z,
},
[armStarWaysEnums.mainMirrorToHalfMirror]: {
arm: z,
directionToCoord: forward,
startPos: -end[z],
wayLength: centerDistance.obs.z,
pseudoWayLength: null,
velocity: velocity.obs.z,
},
[armStarWaysEnums.sideMirrorToHalfMirror]: {
arm: x,
directionToCoord: backward,
startPos: end[x],
wayLength: centerDistance.obs.x,
pseudoWayLength: null,
velocity: velocity.obs.x,
},
// end half a beam behind source to show no beam at the very end
Expand All @@ -552,13 +566,15 @@ <h2 id="headline"></h2>
startPos: end[z],
// wayLength: laserBeamLength / 2,
wayLength: laserPartLength,
pseudoWayLength: null,
velocity: velocity.obs.z,
},
[armStarWaysEnums.behindSourceToBeamOutOfSight]: {
arm: z,
directionToCoord: forward,
startPos: end[z] + laserBeamLength / 2,
wayLength: laserPartLength, // Wolle
pseudoWayLength: null,
velocity: 0.0, // Wolle
},
// end half in screen to show no beam at the very end
Expand All @@ -567,6 +583,7 @@ <h2 id="headline"></h2>
directionToCoord: backward,
startPos: -end[x],
wayLength: laserPartLength, // Wolle
pseudoWayLength: null,
velocity: 0.0, // Wolle
},
}
Expand All @@ -575,16 +592,20 @@ <h2 id="headline"></h2>
armStarWaysNames.forEach(name => {
armStarWays[name].name = name
if (logArmStarData) {
console.log('name: ', name)
// console.log('name: ', name)
}
if (armStarWays[name].velocity === 0.0) {
if (logArmStarData) {
console.log('armStarWays[name].velocity: ', armStarWays[name].velocity)
console.log('velocity.obs.x: ', velocity.obs.x)
// console.log('armStarWays[name].velocity: ', armStarWays[name].velocity)
// console.log('velocity.obs.x: ', velocity.obs.x)
}
armStarWays[name].timeLength = endlessTimeLength
} else {
armStarWays[name].timeLength = armStarWays[name].wayLength / armStarWays[name].velocity
if (armStarWays[name].pseudoWayLength) {
armStarWays[name].timeLength = armStarWays[name].pseudoWayLength / armStarWays[name].velocity
} else {
armStarWays[name].timeLength = armStarWays[name].wayLength / armStarWays[name].velocity
}
}
})

Expand Down Expand Up @@ -656,7 +677,7 @@ <h2 id="headline"></h2>
}


// drawGrid will determine blocksize based on the
// drawGrid will determine blocksize based on the
// amount of horizontal gridlines to draw
function drawGrid({
width,
Expand Down Expand Up @@ -753,21 +774,22 @@ <h2 id="headline"></h2>
// stand still position
// move = centerDistance.obs.z / 2
move =
armStarWays.beforeSourceToBeamOutOfSight.timeLength
+ armStarWays.beforeSource.timeLength
// // + armStarWays.sourceToHalfMirror.timeLength / 2
+ armStarWays.sourceToHalfMirror.timeLength
+ armStarWays.halfMirrorToMainMirror.timeLength
0
// + armStarWays.beforeSourceToBeamOutOfSight.timeLength
// + armStarWays.beforeSource.timeLength
// // // + armStarWays.sourceToHalfMirror.timeLength / 2
// + armStarWays.sourceToHalfMirror.timeLength
// + armStarWays.halfMirrorToMainMirror.timeLength
// // + laserBeamLength
// + armStarWays.mainMirrorToHalfMirror.timeLength
// + armStarWays.halfMirrorToSource.timeLength
// // // - 0.01
// // + laserPartLength // Wolle
// // // + armStarWays.XXX.timeLength
// + armStarWays.halfMirrorToSource.timeLength
// + armStarWays.behindSource.timeLength
// + armStarWays.behindSourceToBeamOutOfSight.timeLength
// + laserBeamLength
+ armStarWays.mainMirrorToHalfMirror.timeLength
+ armStarWays.halfMirrorToSource.timeLength
// // - 0.01
// + laserPartLength // Wolle
// // + armStarWays.XXX.timeLength
+ armStarWays.halfMirrorToSource.timeLength
+ armStarWays.behindSource.timeLength
+ armStarWays.behindSourceToBeamOutOfSight.timeLength
+ laserBeamLength
}
const partPos =
laserPartsPositionCenterCorrection
Expand Down Expand Up @@ -802,7 +824,7 @@ <h2 id="headline"></h2>
({ arm, directionToCoord: armDirection, startPos: armStart }
= usedArmWays[indexArmStar])
moveConsumed = localMoveConsumed
if (logArmStarData && indexLaserSplit === 2 && indexLaserPart === 10) {
if (logArmStarData && indexLaserSplit === logLaserSplitIndex && indexLaserPart === logArmStarIndex) {
console.log('indexLaserSplit: ', indexLaserSplit)
console.log('indexLaserPart: ', indexLaserPart)
console.log('indexArmStar: ', indexArmStar)
Expand All @@ -818,12 +840,25 @@ <h2 id="headline"></h2>
}
}
let armPos
if (usedArmWays[indexArmStar].timeLength !== endlessTimeLength) {
armPos = armStart + armDirection * (move - moveConsumed)
if (usedArmWays[indexArmStar].wayLength !== compressedWayLength
&& usedArmWays[indexArmStar].timeLength !== endlessTimeLength) {
armPos = armStart + armDirection * (move - moveConsumed)
} else {
armPos = armStart + armDirection * moveConsumed
if (usedArmWays[indexArmStar].timeLength === endlessTimeLength) {
armPos = armStart + armDirection * moveConsumed
} else {
if (usedArmWays[indexArmStar].wayLength === compressedWayLength
&& move < 0.0) {
// Wolle
console.log('compressedWayLength !!!')
// console.log('move: ', move)
armPos = armStart + armDirection * (0.0 - moveConsumed)
} else {
armPos = armStart + armDirection * (move - moveConsumed)
}
}
}
if (logArmStarData && indexLaserSplit === 2 && indexLaserPart === 10) {
if (logArmStarData && indexLaserSplit === logLaserSplitIndex && indexLaserPart === logArmStarIndex) {
console.log('move: ', move)
console.log('armPos: ', armPos)
}
Expand Down Expand Up @@ -895,14 +930,14 @@ <h2 id="headline"></h2>
return { laserWaveGroup, laserParts }
}

const laserSplitedAddDistance = (index) =>
const laserSplitedAddDistance = (index) =>
laserSlpitsSeparated ?
laserSlpitsPositionCenterCorrection
// shift to the next split
+ laserSlpitsPositionDistance * index
: 0

const laserSplitPositionSet = (laserSplit, index) =>
const laserSplitPositionSet = (laserSplit, index) =>
laserSplit.position.set(
0,
centerHeightPosition + (laserSlpitsSeparated ? laserSplitedAddDistance( index ) : 0),
Expand Down Expand Up @@ -1071,16 +1106,16 @@ <h2 id="headline"></h2>
bowls.forEach((bowl, index) => {
bowlsGroup.add( bowl )
switch (index) {
case 0:
case 0:
bowl.position.set(centerDistance.ins.x, 0, centerDistance.ins.z)
break
case 1:
case 1:
bowl.position.set(centerDistance.ins.x, 0, -centerDistance.ins.z)
break
case 2:
case 2:
bowl.position.set(-centerDistance.ins.x, 0, centerDistance.ins.z)
break
case 3:
case 3:
bowl.position.set(-centerDistance.ins.x, 0, -centerDistance.ins.z)
break
}
Expand Down