donmccurdy / three-gltf-viewer

Drag-and-drop preview for glTF 2.0 models in WebGL using three.js.
https://gltf-viewer.donmccurdy.com/
MIT License
2.09k stars 534 forks source link

increasing transparency of a model. #288

Closed i3roly closed 2 years ago

i3roly commented 2 years ago

hello again don,

since i already emailed you, i figured this would probably be more appropriate as others may have the same question. i apologise in advance for the overlap.

the creator of an R package (rgl) dr duncan murdoch (@dmurdoch), has updated it to export gltf files.

for myself, a huge beneficiary of his package, this is a big deal.

my current webspace ( http://fluxions.dydx.ie:1338 ) loads webGL in an HTML.

as you can see the pages are large but the figure quality is high; however performance is merely ‘adequate’.

i came across your ‘fiddle’ https://jsfiddle.net/donmccurdy/6b5j9p3y/ and have inspected the existing gltf viewers.

just want to know if i can increase the transparency of the skeleton or possibly decrease the thickness of the edges in the wireframe.

this thing is gonna haul ass! e955cd3ef0b240b87cb91e207fc9c522

i am seeking a simple solution:

all i want to do is try and maintain my current layout with multiple GLTF files rendered side by side, each with some fixed resolution so that it can look like a ‘grid’.

your fiddle demo seems close to what i’d like, but what i’m not sure is if it’s literally that simple as copy+pasting the html code.

while i’m no javascript expert (or novice), i was hoping to get some quick direction on how to update my page with this cutting-edge GLTF viewer, which will take my audience’ experience to the maximum.

thanks in advance!

i3roly commented 2 years ago

this thing is the bomb, @donmccurdy

i'm using your jsfiddle code with some tweaks and i wanted to ask you if there's any way to change the default settings.

for example i'd like to have wireframe mode enabled for each pane.

i tried running this viewer, along with the threejs directory source, using servez, but it wouldn't go into kiosk mode for some reason, instead asking me to load a file even though i was running the untouched jsfiddle code.

i3roly commented 2 years ago

@donmccurdy is there a reason the gltf-viewer snippets (lavadragon example) wouldn't work with a custom URL?

http://fluxions.dydx.ie:1338/mapsgl/neurocon/hmaps_d38/h_map_dim9.gltf resolves fine, but if i input it as the model to either code piece:

https://jsfiddle.net/donmccurdy/6b5j9p3y/ https://codepen.io/donmccurdy/pen/rwXBRr?css-preprocessor=stylus

it fails to get the file. found this strange.

i3roly commented 2 years ago

my bad donny @donmccurdy turns out it was me (why am i always the last one to figure this out?! ;D)

it's like our headers and food have something in common: if it aint COR(s), then it ain't workin!

i'm gonna retitle this issue though because i wanted to ask if there's a way to add more transparency to the model display. Screenshot 2022-02-03 at 3 43 46 PM

i3roly commented 2 years ago

http://fluxions.dydx.ie:1338

it's up donny baby @donmccurdy

yo dr @dmurdoch, we live.

may be a few bugs here and there, eventually i'll get to them. maybe i'll make each rendering slightly larger, but 400x400 is pushing it when i'm tiling 4 in a row sometimes.

as i said in our correspondence: this is some next level shit

IT'S SO FAST.

thephutureisall

donmccurdy commented 2 years ago

CORS can be a headache, but glad you got the issues solved and it's working. And great use case!