Skip to content
Snippets Groups Projects
Commit 06f84e6e authored by Alexander Rose's avatar Alexander Rose
Browse files

wip, lines

parent 230c5c0d
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ export namespace Geometry { ...@@ -25,7 +25,7 @@ export namespace Geometry {
switch (geometry.kind) { switch (geometry.kind) {
case 'mesh': return geometry.triangleCount * 3 case 'mesh': return geometry.triangleCount * 3
case 'points': return geometry.pointCount case 'points': return geometry.pointCount
case 'lines': return geometry.lineCount case 'lines': return geometry.lineCount * 2 * 3
} }
} }
......
...@@ -33,10 +33,8 @@ export namespace LinesBuilder { ...@@ -33,10 +33,8 @@ export namespace LinesBuilder {
ChunkedArray.add2(mappings, -1, -1); ChunkedArray.add2(mappings, -1, -1);
ChunkedArray.add2(mappings, 1, 1); ChunkedArray.add2(mappings, 1, 1);
ChunkedArray.add2(mappings, 1, -1); ChunkedArray.add2(mappings, 1, -1);
// ChunkedArray.add3(indices, offset, offset + 1, offset + 2); ChunkedArray.add3(indices, offset, offset + 1, offset + 2);
// ChunkedArray.add3(indices, offset + 1, offset + 3, offset + 2); ChunkedArray.add3(indices, offset + 1, offset + 3, offset + 2);
ChunkedArray.add3(indices, offset + 2, offset + 1, offset);
ChunkedArray.add3(indices, offset + 2, offset + 3, offset + 1);
}, },
getLines: () => { getLines: () => {
const mb = ChunkedArray.compact(mappings, true) as Float32Array const mb = ChunkedArray.compact(mappings, true) as Float32Array
...@@ -44,7 +42,6 @@ export namespace LinesBuilder { ...@@ -44,7 +42,6 @@ export namespace LinesBuilder {
const gb = ChunkedArray.compact(groups, true) as Float32Array const gb = ChunkedArray.compact(groups, true) as Float32Array
const sb = ChunkedArray.compact(starts, true) as Float32Array const sb = ChunkedArray.compact(starts, true) as Float32Array
const eb = ChunkedArray.compact(ends, true) as Float32Array const eb = ChunkedArray.compact(ends, true) as Float32Array
console.log(indices.elementCount, mappings.elementCount, groups.elementCount)
return { return {
kind: 'lines', kind: 'lines',
lineCount: indices.elementCount / 2, lineCount: indices.elementCount / 2,
......
...@@ -12,11 +12,11 @@ import { MarkerAction } from '../../../geometry/marker-data'; ...@@ -12,11 +12,11 @@ import { MarkerAction } from '../../../geometry/marker-data';
import { Loci } from 'mol-model/loci'; import { Loci } from 'mol-model/loci';
import { PickingId } from '../../../geometry/picking'; import { PickingId } from '../../../geometry/picking';
import { Task } from 'mol-task'; import { Task } from 'mol-task';
import { GaussianDensityPointVisual, DefaultGaussianDensityPointProps } from '../visual/gaussian-density-point'; import { GaussianDensityPointVisual } from '../visual/gaussian-density-point';
import { DefaultGaussianWireframeProps, GaussianWireframeVisual } from '../visual/gaussian-surface-wireframe'; import { DefaultGaussianWireframeProps, GaussianWireframeVisual } from '../visual/gaussian-surface-wireframe';
export const DefaultSurfaceProps = { export const DefaultSurfaceProps = {
// ...DefaultGaussianSurfaceProps, ...DefaultGaussianSurfaceProps,
// ...DefaultGaussianDensityPointProps, // ...DefaultGaussianDensityPointProps,
...DefaultGaussianWireframeProps, ...DefaultGaussianWireframeProps,
} }
...@@ -40,7 +40,7 @@ export function SurfaceRepresentation(): SurfaceRepresentation { ...@@ -40,7 +40,7 @@ export function SurfaceRepresentation(): SurfaceRepresentation {
createOrUpdate: (props: Partial<SurfaceProps> = {}, structure?: Structure) => { createOrUpdate: (props: Partial<SurfaceProps> = {}, structure?: Structure) => {
currentProps = Object.assign({}, DefaultSurfaceProps, currentProps, props) currentProps = Object.assign({}, DefaultSurfaceProps, currentProps, props)
return Task.create('Creating SurfaceRepresentation', async ctx => { return Task.create('Creating SurfaceRepresentation', async ctx => {
// await gaussianSurfaceRepr.createOrUpdate(currentProps, structure).runInContext(ctx) await gaussianSurfaceRepr.createOrUpdate(currentProps, structure).runInContext(ctx)
// await gaussianPointRepr.createOrUpdate(currentProps, structure).runInContext(ctx) // await gaussianPointRepr.createOrUpdate(currentProps, structure).runInContext(ctx)
await gaussianWireframeRepr.createOrUpdate(currentProps, structure).runInContext(ctx) await gaussianWireframeRepr.createOrUpdate(currentProps, structure).runInContext(ctx)
}) })
......
...@@ -424,7 +424,7 @@ export function UnitsLinesVisual<P extends UnitsLinesProps>(builder: UnitsLinesV ...@@ -424,7 +424,7 @@ export function UnitsLinesVisual<P extends UnitsLinesProps>(builder: UnitsLinesV
lines = newProps.unitKinds.includes(unit.kind) lines = newProps.unitKinds.includes(unit.kind)
? await createLines(ctx, unit, currentStructure, newProps, lines) ? await createLines(ctx, unit, currentStructure, newProps, lines)
: Lines.createEmpty(lines) : Lines.createEmpty(lines)
ValueCell.update(renderObject.values.drawCount, lines.lineCount) ValueCell.update(renderObject.values.drawCount, lines.lineCount * 2 * 3)
updateState.updateColor = true updateState.updateColor = true
} }
......
...@@ -11,7 +11,7 @@ import { Box3D } from 'mol-math/geometry'; ...@@ -11,7 +11,7 @@ import { Box3D } from 'mol-math/geometry';
import { SizeTheme } from 'mol-view/theme/size'; import { SizeTheme } from 'mol-view/theme/size';
export const DefaultGaussianDensityProps = { export const DefaultGaussianDensityProps = {
resolutionFactor: 4, resolutionFactor: 6,
radiusOffset: 0, radiusOffset: 0,
smoothness: 1.5, smoothness: 1.5,
} }
......
...@@ -119,9 +119,4 @@ void main(){ ...@@ -119,9 +119,4 @@ void main(){
offset *= clip.w; offset *= clip.w;
clip.xy += offset; clip.xy += offset;
gl_Position = clip; gl_Position = clip;
// gl_Position = uProjection * (modelView * vec4(aEnd.x * 5.0 - 5.0, aMapping.y * 5.0, 2.0, 1.0));
// TODO
// vViewPosition = (projectionMatrixInverse * clip).xyz;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment