SSR错误Three.js物体

您好,我正在切换到服务器端渲染Three.js对象以节省多余的计算量。n我当前正在运行一台服务器,执行数据cron作业,并将其输出到客户端。安装后Three.js在节点服务器上,我为数据对象移植了旧的客户端呈现代码。然后将其与一些其他数据类型分组,我将其发送到前端。n然而,现在我的问题是,当我将对象拉入客户端时,我得到一个错误,即它不是ThreeJs对象!我在logger中检查并发现它与在客户端本地创建的对象不同。我不明白,因为我放在服务器上的代码以前在客户机上工作过。也许我错过了什么?n这是服务器上运行的代码。nn//循环API url,生成AJAX请求,存储在全局n中,用于(let>请求(url+urlSuffix[i]、函数(错误、响应、主体){nif (response.statusCode == 200) = new THREE.MeshBasicMaterial({ vertexColors: true });// Data Parsingfor (const feature of parsedBody.features) {// Quake = = longLatToSphere(coordinates[0], = new THREE.BoxGeometry(3, 3, cubeHeight, 1, => b.magnitude - a.magnitude);// Store>n}n})nIt is stored in a larger object as a value and then sent to the client. I then store those into Redux and then the visualization takes them from Redux and into a scene loader array, iterates and render.nHere is the schema/keys of the objects I get back from the servern{ndata: {vertices: Array(504), normals: Array(426), colors: Array(18), uvs: Array(1), faces: Array(3276)}nmetadata: {version: 4.5, type: \"Geometry\", generator: \"Geometry.toJSON\"}ntype: \"Geometry\"nuuid: \"9A6BB7E5-B134-497A-ABD7-302D42E1FAD4\"n}nMost likely it will be sent to the client as json, therefore as a serialized object. So you\"d need to convert it back to a threejs object with the object loader:nhttps://threejs.org/docs/#api/en/loaders/ObjectLoader 31nHmm so I went to implement the object loader but it looks like it requires a file to work from. Is there a way to load JSON from a variable in memory without editing the standard loader file?nAt the bottom of the example in the linked page, there is a way to work with a json object directly:n// Alternatively, to parse a previously loaded JSON structurevar>nDoes that help you?nThis doesn\"t seem to work for me. When I try to parse it straight with the loader then I get an error. When i try to parse it after I JSON.parse it then I also get an error.nloader.parse without JSON.parse beforenobj loader parsedOBJLoader.js:414 Uncaught Error: THREE.OBJLoader: Unexpected line: \"{\"metadata\":{\"version\":4.5,\"type\":\"Geometry\",\"generator\":\"Geometry.toJSON\"},\"uuid\":\"45BA4531-AF9C-46F9-AB7F-551D404284C2\",\"type\":\"Geometry\",\"data\":{\"vertices\":[-253.72886863413882,377.0505462864755,391.12638200637485,-254.06594580633598,377.55138696472005,391.6496707449355,-254.74729809664012,374.7132161229377,392.70742252974094,-255.08437526883728,375.21405680118227,393.2307112683016,-251.54389622397878,377.55138696472005,393.27425250776923,-251.20681905178162,377.0505462864755,392.75096376920857,-252.56232568648008,375.21405680118227,394.8552930311353,-252.22524851428292,374.7132161229377,394.33200429257465,-253.8250244342498,377.13808325572404,390.90513403710816,-254.20323077661746,377.6999508207422,391.491718090364,-254.84445493817964,374.80122910134276,392.4862330564008,-255.2226612805473,375.3630966663609,393.0728171096566,-251.68188081229232,377.6999508207422,393.11738544791217,-251.30367446992466,377.13808325572404,392.53080139465635,-252.70131131622216,375.3630966663609,394.6984844672048,-252.3231049738545,374.80122910134276,394.111900413949,-221.3862957497906,345.3972769280417,415.4910366456231,-233.54445011061603,364.377610457773,438.4853246825743,-222.21288626910749,342.97388330510375,417.0543381078111,-234.3710406299329,361.95421683483505,440.04862614476224,-230.8923573799623,364.377610457773,439.8876100130309,-218.73420301913688,345.3972769280417,416.89332197607973,-231.7189478992792,361.95421683483505,441.45091147521885,-219.56079353845377,342.97388330510375,418.4566234382677,-222.96474213086472,349.4926766949184,421.476297299868,-229.58879461137113,359.882481099213,434.09379444402003,-223.78626616322134,347.0685528382245,423.0411365221743,-230.41031864372775,357.4583572425191,435.6586336663263,-226.93258933459418,359.882481099213,435.4882741059808,-220.30853685408778,349.4926766949184,422.8707769618288,-227.7541133669508,357.4583572425191,437.0531133282871,-221.1300608864444,347.0685528382245,424.4356161841351,-508.0926340969651,198.34483889923865,232.44258945642605,-520.2668771249058,203.06504218804963,238.05164328718965,-508.9976484541264,195.51515934257083,232.85955782442076,-521.171891482067,200.2353626313818,238.46861165518436,-519.011516121845,203.06504218804963,240.776357722134,-506.83727309390434,198.34483889923865,235.1673038913704,-519.9165304790063,200.2353626313818,241.19332609012872,-507.74228745106564,195.51515934257083,235.58427225936512,-221.4200975562854,338.29613197017017,441.74333473786027,-222.27757937876774,339.60715741081844,443.467093199403,-222.17215712397874,335.8164609539931,443.2551674197971,-223.02963894646106,337.1274863946414,444.97892588133976,-219.59156253097623,339.60715741081844,444.8032494377899,-218.7340807084939,338.29613197017017,443.0794909762472,-220.34362209866956,337.1274863946414,446.3150821197267,-219.48614027618723,335.8164609539931,444.59132365818397,-224.15292986473023,352.9993803329295,428.8786788979242,-224.9079096223807,354.18915916095256,430.3341771788696,-224.964197700737,350.57127313148254,430.4426929376765,-225.71917745838746,351.7610519595056,431.89819121862195,-222.24485312586617,354.18915916095256,431.7155280019308,-221.4898733682157,352.9993803329295,430.26002972098536,-223.05612096187295,351.7610519595056,433.2795420416831,-222.30114120422246,350.57127313148254,431.8240437607377,-224.38162476494833,349.30876993112486,429.84338367676486,-226.17716816266017,352.1058392146166,433.3091637866271,-225.1854623934278,346.8702349614538,431.39496102537873,-226.98100579113964,349.6673042449455,434.86074113524097,-223.51342488570836,352.1058392146166,434.6891897843873,-221.71788148799652,349.30876993112486,431.22340967452504,-224.31726251418783,349.6673042449455,436.24076713300116,-222.521719116476,346.8702349614538,432.7749870231389,-224.97524688785103,350.20287295629214,430.96460755099775,-225.61020227150223,351.191909509324,432.19013647574684,-225.77909777899663,347.7643024044278,432.51612210406665,-226.41405316264783,348.7533389574596,433.74165102881574,-222.946491109132,351.191909509324,433.5702244597045,-222.3115357254808,350.20287295629214,432.3446955349554,-223.7503420002776,348.7533389574596,435.1217390127734,-223.1153866166264,347.7643024044278,433.8962100880243,-224.79354796410018,348.7089752581558,430.7798241992161,-226.23265026104085,350.9428072936244,433.55850752435856,-225.5951475744988,346.26728259404086,432.3275887157418,-227.03424987143944,348.50111462950946,435.1062720408843,-223.56872234782014,350.9428072936244,434.93817707652084,-222.1296200508795,348.7089752581558,432.15949375137836,-224.37032195821877,348.50111462950946,436.48594159304656,-222.9312196612781,346.26728259404086,433.7072582679041,-222.91276276047807,533.2446067646291,132.7161992935562,-228.18440063724387,545.8182825185447,135.89621692426851,-225.2198610504757,531.925353531371,134.10791348362113,-230.4914989272415,544.4990292852866,137.28793111433345,-226.6348141008771,545.8182825185447,138.46502629172085,-221.36317622OBJLoader.js:414) at XMLHttpRequest.t.onreadystatechange (index.js:101)n加载器解析之后JSON.parsen{metadata: {…}, uuid: \"1E8F2F88-305C-433C-A725-D0DBB1BF8784\", type: \"Geometry\", data: {…}}data: {vertices: Array(768), normals: Array(618), colors: Array(23), uvs: Array(1), faces: Array(4992)}colors: (23) [1893120, 1762560, 2350080, 1697280, 2219520, 3394560, 2154240, 2611200, 1175040, 2872320, 2023680, 2480640, 1566720, 1109760, 1827840, 5614080, 1305600, 3198720, 2676480, 2545920, 2937600, 1240320, 2807040]faces: (4992) [122, 0, 2, 1, 0, 0, 1, 2, 0, 0, 0, 0, 0, 122, 2, 3, 1, 0, 1, 3, 2, 0, 0, 0, 0, 0, 122, 4, 6, 5, 1, 0, 1, 2, 1, 1, 1, 1, 0, 122, 6, 7, 5, 1, 1, 3, 2, 1, 1, 1, 1, 0, 122, 4, 5, 1, 2, 0, 1, 2, 2, 2, 2, 2, 0, 122, 5, 0, 1, 2, 1, 3, 2, 2, 2, 2, 2, 0, 122, 7, 6, 2, 3, 0, 1, 2, 3, 3, 3, 3, 0, 122, 6, 3, 2, 3, 1, 3, 2, 3, …]normals: (618) [-0.895338949263834, 2.775557561562892e-17, -0.44538541279563026, 0.895338949263834, -2.775557561562892e-17, 0.44538541279563026, 0.2506865225644415, 0.8265570053923591, -0.5039442273122726, -0.2506865225644415, -0.8265570053923591, 0.5039442273122726, 0.36813643304579585, -0.5628530153040097, -0.7400486807146559, -0.36813643304579585, 0.5628530153040097, 0.7400486807146559, -0.8876854988381758, -2.7755575615628914e-17, -0.4604502743537236, -0.8876854988381757, -2.7755575615628914e-17, -0.46045027435372354, 0.8876854988381758, 2.7755575615628914e-17, 0.4604502743537236, 0.8876854988381757, 2.7755575615628914e-17, 0.46045027435372354, 0.2704226120022505, 0.8093690671489893, -0.5213380132507656, -0.2704226120022505, -0.8093690671489893, 0.5213380132507656, 0.3726742090221693, -0.587300360243696, -0.7184651841163394, -0.3726742090221693, 0.587300360243696, 0.7184651841163394, -0.887914425650601, -2.775557561562892e-17, -0.46000866592007095, 0.887914425650601, 2.775557561562892e-17, 0.46000866592007095, 0.267945876159819, 0.8128449898903648, -0.5171924495379646, -0.267945876159819, -0.8128449898903648, 0.5171924495379646, 0.3739157393992803, -0.5824800618133918, -0.7217367923414718, -0.3739157393992803, 0.5824800618133918, 0.7217367923414718, -0.8879037207900708, 0, -0.4600293279858885, 0.8879037207900708, 0, 0.4600293279858885, 0.26795029704853784, 0.8128568506214409, -0.5171715176896278, -0.26795029704853784, -0.8128568506214409, 0.5171715176896278, 0.37393799074010714, -0.5824635099281265, -0.721738622136476, -0.37393799074010714, 0.5824635099281265, 0.721738622136476, -0.8879759710735624, 2.7755575615628914e-17, -0.45988985072076133, 0.8879759710735624, -2.7755575615628914e-17, 0.45988985072076133, 0.26719987013287244, 0.8138975547049798, -0.515921505508571, -0.26719987013287244, -0.8138975547049798, 0.515921505508571, 0.3743032249352658, -0.5810084082397211, -0.7227214714935523, -0.3743032249352658, 0.5810084082397211, 0.7227214714935523, -0.5165288454555907, 1.9428902930940235e-16, -0.8562697891507762, 0.5165288454555907, …]uvs: [Array(8)]vertices: (768) [-221.4200975562854, 338.29613197017017, 441.74333473786027, -222.27757937876774, 339.60715741081844, 443.467093199403, -222.17215712397874, 335.8164609539931, 443.2551674197971, -223.02963894646106, 337.1274863946414, 444.97892588133976, -219.59156253097623, 339.60715741081844, 444.8032494377899, -218.7340807084939, 338.29613197017017, 443.0794909762472, -220.34362209866956, 337.1274863946414, 446.3150821197267, -219.48614027618723, 335.8164609539931, 444.59132365818397, -224.15292986473023, 352.9993803329295, 428.8786788979242, -224.9079096223807, 354.18915916095256, 430.3341771788696, -224.964197700737, 350.57127313148254, 430.4426929376765, -225.71917745838746, 351.7610519595056, 431.89819121862195, -222.24485312586617, 354.18915916095256, 431.7155280019308, -221.4898733682157, 352.9993803329295, 430.26002972098536, -223.05612096187295, 351.7610519595056, 433.2795420416831, -222.30114120422246, 350.57127313148254, 431.8240437607377, -224.38162476494833, 349.30876993112486, 429.84338367676486, -226.17716816266017, 352.1058392146166, 433.3091637866271, -225.1854623934278, 346.8702349614538, 431.39496102537873, -226.98100579113964, 349.6673042449455, 434.86074113524097, -223.51342488570836, 352.1058392146166, 434.6891897843873, -221.71788148799652, 349.30876993112486, 431.22340967452504, -224.31726251418783, 349.6673042449455, 436.24076713300116, -222.521719116476, 346.8702349614538, 432.7749870231389, -224.97524688785103, 350.20287295629214, 430.96460755099775, -225.61020227150223, 351.191909509324, 432.19013647574684, -225.77909777899663, 347.7643024044278, 432.51612210406665, -226.41405316264783, 348.7533389574596, 433.74165102881574, -222.946491109132, 351.191909509324, 433.5702244597045, -222.3115357254808, 350.20287295629214, 432.3446955349554, -223.7503420002776, 348.7533389574596, 435.1217390127734, -223.1153866166264, 347.7643024044278, 433.8962100880243, -224.79354796410018, 348.7089752581558, 430.7798241992161, -226.23265026104085, …]__proto__: Objectmetadata: {version: 4.5, type: \"Geometry\", generator: \"Geometry.toJSON\"}type: \"Geometry\"uuid: \"1E8F2F88-305C-433C-A725-D0DBB1BF8784\"__proto__: Objectindex.js:99 obj loader parsedOBJLoader.js:276 Uncaught TypeError: o.indexOf is not a functionat o.parse (OBJLoader.js:276)at XMLHttpRequest.t.onreadystatechange (index.js:101)n我真的需要看看正确帮助的code,因为这似乎真正取决于服务器和客户机的通信方式。但作为猜测,您的服务器似乎没有使用threejs.toJSON()序列化对象。它可能只是将它们视为默认对象,因此忽略了三个js属性。n您能在git repo或jsfiddle上共享您的代码吗?n我不知道JSON.stringify及JSON.parse删除属性。n以下是CRON Three服务器的要点。https://gist.github.com/mpaccione/19b7f13ec8600bc37d2927b3ac696d849n数据与一些标准JSON一起作为一个大JSON对象发送到前端。然后数据被传递到redux状态并渲染。n啊,你在显示地震吗?我喜欢这种类型的项目,非常有用。n所以我会尝试在第61行和第71行发送threeData.toJSON(),而不仅仅是threeData。让我知道这是否修复了客户端的加载程序。n作为旁注,我对第122geom.merge(cube.geometry, cube.matrix)行感到困惑,不确定这是在做什么。检查文档,我看到.merge ( bufferGeometry : BufferGeometry, offset : Integer ),显示第二个参数应该是整数,而不是矩阵。也许你做的是对的,我说不出来,但那可能是需要注意的事情。n而且,不是这样JSON.stringify及JSON.parse如果对象是标准对象,则删除属性,但这会丢失它是threejs对象的事实,以及附加到它的方法。因此,需要使用.toJSON()和ObjectLoader。(我可能还不知道其他原因)n以及由此产生的错误…nUncaught Error: THREE.OBJLoader: Unexpected line: \"{\"0\":{\"metadata\":{\"version\":4.5,\"type\":\"Geometry\",\"generator\":\"Geometry.toJSON\"},\"uuid\":\"9D04F728-DCB9-44B1-A089-045C1CAB9D2E\",\"type\":\"Geometry\",\"data\":{\"vertices\":[...nEDITn。这是一个相当大的疏忽,因为在复印工作中遗漏了一两行。n// create a new mesh, containing all the other>nEven after fixing this I can\"t get it to go. I\"m rather close to giving up at this point and just scrapping the whole project since the performance on clientside rendering has too many calculations to be feasible for phones.nDon\"t give up so quickly. Coding always gets hard at some point, but it\"s really rewarding when you go past that.nAnd as a last resort, you should really share the full repo, so it would be easier to help. At the moment, I\"m doing a lot of guessing.nBut I assume you have tried this?nYou may have, since the line is commented in your snippet, but just making sure. And it may depend if your xhr gives you the response in a string or as a json object. I never use xhr directly, so can\"t tell (I use the library axios, which makes requests more intuitive)nI am using XHR because fetch doesn\"t have a progress API afaik, which is why everyone uses indeterminate loading bars. Axios is built on fetch so I can\"t use it.nThis is the error below I receive when double parsing like you suggested. It truly shouldn\"t be this hard to have basic three js 3D Objects made on server side and sent to the client. I\"ve been held up re-releasing this app to the play store for almost a month because of this.nWhat is your github I will invite you and chip you some $ if you get it going? At this rate though I think it\"s a lost cause. I think I might be better off just fcking server side rendering off altogether and running it in a web worker so the apk doesn\"t hang when parsing the dataset.nreact-dom.production.min.js:4408 TypeError: r.indexOf is not a functionat r.parse (OBJLoader.js:276)at t.e.addData (index.js:449)at t.value (index.js:180)at Ga (react-dom.production.min.js:4978)at Va (react-dom.production.min.js:5123)at react-dom.production.min.js:5975at Object.t.unstable_runWithPriority (scheduler.production.min.js:274)at Os (react-dom.production.min.js:5974)at Ps (react-dom.production.min.js:5958)at As (react-dom.production.min.js:5925)ha @ react-dom.production.min.js:4408n.callback @ react-dom.production.min.js:4773ia @ react-dom.production.min.js:4271ra @ react-dom.production.min.js:4257Ga @ react-dom.production.min.js:4999Va @ react-dom.production.min.js:5123(anonymous) @ react-dom.production.min.js:5975t.unstable_runWithPriority @ scheduler.production.min.js:274Os @ react-dom.production.min.js:5974Ps @ react-dom.production.min.js:5958As @ react-dom.production.min.js:5925Es @ react-dom.production.min.js:5860(anonymous) @ react-dom.production.min.js:5761Promise.then (async)(anonymous) @ react-dom.production.min.js:4747ba @ react-dom.production.min.js:4745ja @ react-dom.production.min.js:4910Va @ react-dom.production.min.js:5104(anonymous) @ react-dom.production.min.js:5975t.unstable_runWithPriority @ scheduler.production.min.js:274Os @ react-dom.production.min.js:5974Ps @ react-dom.production.min.js:5958As @ react-dom.production.min.js:5925Es @ react-dom.production.min.js:5860Ka @ react-dom.production.min.js:5787enqueueSetState @ react-dom.production.min.js:2790x.setState @ react.production.min.js:72u.onStateChange @ connectAdvanced.js:205v @ redux.js:213e @ VM17:1(anonymous) @ middleware.js:40dispatch @ VM17:1onLocationChanged @ ConnectedRouter.js:193a @ ConnectedRouter.js:129r @ history.js:162(anonymous) @ history.js:180notifyListeners @ history.js:179A @ history.js:300(anonymous) @ history.js:381confirmTransitionTo @ history.js:152push @ history.js:362(anonymous) @ index.js:50setTimeout (async)value @ index.js:50Ga @ react-dom.production.min.js:4980Va @ react-dom.production.min.js:5123(anonymous) @ react-dom.production.min.js:5975t.unstable_runWithPriority @ scheduler.production.min.js:274Os @ react-dom.production.min.js:5974Ps @ react-dom.production.min.js:5958As @ react-dom.production.min.js:5925Es @ react-dom.production.min.js:5860Ka @ react-dom.production.min.js:5787enqueueSetState @ react-dom.production.min.js:2790x.setState @ react.production.min.js:72u.onStateChange @ connectAdvanced.js:205notify @ Subscription.js:23t.notifyNestedSubs @ Subscription.js:62u.onStateChange @ connectAdvanced.js:202notify @ Subscription.js:23t.notifyNestedSubs @ Subscription.js:62u.onStateChange @ connectAdvanced.js:202v @ redux.js:213e @ VM17:1(anonymous) @ middleware.js:40dispatch @ VM17:1setProgressComplete @ index.js:21t.onprogress @ index.js:87XMLHttpRequest.send (async)value @ index.js:146onClick @ index.js:175(anonymous) @ react-dom.production.min.js:49h @ react-dom.production.min.js:69(anonymous) @ react-dom.production.min.js:73S @ react-dom.production.min.js:140A @ react-dom.production.min.js:169T @ react-dom.production.min.js:158O @ react-dom.production.min.js:232En @ react-dom.production.min.js:1718Is @ react-dom.production.min.js:5990Ne @ react-dom.production.min.js:660An @ react-dom.production.min.js:1760(anonymous) @ react-dom.production.min.js:6017t.unstable_runWithPriority @ scheduler.production.min.js:274Ds @ react-dom.production.min.js:6016Rn @ react-dom.production.min.js:1737OBJLoader.js:276 Uncaught (in promise) TypeError: r.indexOf is not a functionat r.parse (OBJLoader.js:276)at t.e.addData (index.js:449)at t.value (index.js:180)at Ga (react-dom.production.min.js:4978)at Va (react-dom.production.min.js:5123)at react-dom.production.min.js:5975at Object.t.unstable_runWithPriority (scheduler.production.min.js:274)at Os (react-dom.production.min.js:5974)at Ps (react-dom.production.min.js:5958)at As (react-dom.production.min.js:5925)n酷,让我们试试。我的githubhttps://github.com/polygonjs6.nhttps://github.com/mpaccione/usgs_viz/investments4n好的,这是如何工作的…n节点CRON服务器拉取USGS geoJSON数据集。然后它解析并组织数据。它将数据存储在本地内存中,并向客户端发送一个组合的JSON响应。[0]是地震数据,[1]是渲染数据Three.js物体。(index.js)n加载程序然后在客户端发出XHR请求,解析响应并将其存储在Redux状态。(客户端/组件/加载程序)/index.js)n另一个组件开始渲染三个js场景(客户端/组件/viz/index.js)请特别注意addData函数。如果你搜索它,你会看到我在做什么。然后,我将在该函数中尝试第二阶段的OBJLoader解析。请注意,我已经编写了自己的加载程序检查,以确保它不会尝试呈现所有的3D对象和纹理,直到所有的数据都存在。n进程:n在主repo中,您将需要:n1. 节点index.js(这将创建一个CRON服务器来轮询USGS数据集)n2. n3. 打开新的shell和cd到客户机目录中运行start,在尝试客户端之前,需要让CRON服务器运行一分钟以上,然后才能正常运行。可能有一些服务工作者错误,但它们是非阻塞性的,在SSR工作后将被处理。不确定是使用IndexedDB还是finangle只是一个用于缓存SSR对象的软件。啊,应该是THREE.ObjectLoader,而不是OBJLoader。前者加载用.toJSON()转换的三个JS对象,后者加载.obj文件。但我同意这些名字令人困惑。我在那个线程中注意到了这个问题,但是还是没有注意到。在更改之后,我现在得到了错误THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type \"Geometry\".,所以我想您可以继续这个吗?就我个人而言,我会改用BufferGeometry而不是Geometry,以确保它能经得起未来的考验。所以是的,这只是另一个简单的打字错误有些疯狂。非常感谢您提供美元,但只花了几分钟。你看看我的创业公司怎么样https://polygonjs.com/告诉我你对未来的3D网络项目是否感兴趣?它的设计目的是简化交互式场景的创建(从而保持你内心的平静)。我总是很高兴听到正面或负面的反馈。天哪,命名-。-“是的,我以前用过OBJLoader加载3D模型,所以我很困惑。我一定会再试试看。我非常想把这个应用捆绑起来,然后发布出去,这样我就可以继续工作,完成我的其他项目,并在旧金山找到一份工程工作。就你的3D初创企业而言,我觉得GLSL着色器生成器和MapBox集成是最有趣的。我知道你还在开发这个,所以除了一件事,我没什么可以说的。如果人们和我一样,他们在GUI上也很差劲。作为一个程序员,我可能不在这条曲线上,但对于许多接口来说,我更容易读懂code来获得理解。当你进入市场…屏幕盖教程,让人们知道东西在哪里以及它们是如何工作的。你已经有一些在文档部分…它可能是更好的营销功能视频比演示或实际制作一个指导互动教程演示。我想这会走得更远,因为我很快就试过了演示,感觉嗯,好吧,我该做点什么。我祝你在开发自己的软件时好运,这是最令人兴奋的,我的朋友太好了,非常感谢你看了并给出了反馈,这是值得的。是的,我同意当前的演示可以做到用更多的手握住。或者就像你说的,只是一个视频。我也同意gui和code的处理方式是不同的,所以我计划了一些事情来帮助这一部分。是的,在早期开发过程中,视频可能是最好的选择。然后是一个更完整的交互版本,因为您已经接近一个完整的版本。关于JSONLoader…我使用了旧的不推荐版本。它期望的格式似乎与我的格式不同。与此基本相同的问题:https://stackoverflow.com/questions/34929928/threejs-jsonload-cannot-read-property-length-of-undefined1我编辑了加载程序,以查看是否可以使其正常工作。我更改了解析的这一部分===json.geometrics[\"0\"].数据颜色,我想我可能会走运并运行它,但是我在以下位置得到了一个错误:Uncaught TypeError: Cannot read property \"x\" of undefinedat Vector3.subVectors (0.chunk.js:67937)p>人们通常如何将他们的JSON对象从后端发送到前端?我觉得我是在用一种非标准的方式来做这件事,因为这就像是把一个方形的钉子从一个圆孔里推出一样。好的,我想我已经成功了。至少我看到地球上有一些尖峰。而且它看起来不像我对你的回购协议有写权限,所以这里是我所做的:简而言之,我用缓冲几何替换了几何。我认为这是几何在不久的将来被弃用的一种方式。在名字中使用Legacy这个词会让我跑掉。commanded out>在for loop**15***属性前直接添加一个多维数据集列表,将.merge(cube.geometry, cube.matrix);替换为cube.geometry.applyMatrix(cube.matrix)添加到多维数据集列表:**18***并在for loop之后添加一个多维数据集列表:**,将所有多维数据集合并在一起:>>(为此,需要包含BufferGeometryUtilshttps://github.com/mrdoob/three.js/blob/d1f94e361abe6b8ff27fb90c0b947d6e24b86bf/examples/jsm/utils/BufferGeometryUtils.js3-我不熟悉require,所以在我的测试中我把它复制到了index.js删除导入语句后)利润!另外,我还没有听说有人在threejs上使用SSR,但是使用workers似乎更为频繁。我怀疑使用toJSON和ObjectLoader是主要的方法,但如果还有其他方法,我当然也很想听听建议。好的,所以我向美国地质勘探局承诺,我将向他们发送一个应用程序链接。我不得不给他们发电子邮件,说他们的地震数据源api有400个代码。因为我的抱怨,他们改变了整个公共限额xD我真的必须现在就交付这个,哈哈。我好像没法把它弄走。我通读了你的文章,似乎什么都做了。虽然我不太明白你对克隆立方体的看法?无论如何,每次地震都会产生一个新的物体,因为立方体的重量会发生变化。这些物体似乎作为缓冲几何体被发送到前端。我复制粘贴在BufferUtility Code中。是的,你是对的,这三个都不符合要求。我认为,在文档中,有些可能与requires一起工作,但根据我的经验,这是假的,因为browserify和babel似乎与它们不太配合。网页包导入一直对我有效。但此服务器上没有网页包。因此,我通过在in前面添加三个来编辑加载程序不管怎样,在使用ObjectLoader解析它们时,我收到了一个错误:(请注意,我已经在客户端导入了LegacyJSONLoader)19***数组是null。因此,生成的json中有一些可疑之处。如果我可以对您的回购进行拉取请求,可能会更容易,但与此同时,我刚刚向您发送了一个DM,其中包含一个包含我所做更改的回购的zip的链接。希望这只是我解释的那些。我还添加了一个我看到的最终结果的屏幕截图(出于某种原因,在看到地球仪之前,我仍然需要点击10倍左右的“进入Vizalizer”,好像路由器拒绝了路径更改。(对那部分不确定)n Error with SSR Three.js Objectsn

admin_action_{$_REQUEST[‘action’]}

do_action( "admin_action_{$_REQUEST[‘action’]}" )动作钩子::在发送“Action”请求变量时激发。Action Hook: Fires when an ‘action’ request variable is sent.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$_REQUEST['action']引用从GET或POST请求派生的操作。源码(Source)更新版本源码位置使用被使用2.6.0 wp-admin/admin.php:...

日期:2020-09-02 17:44:16 浏览:1173

admin_footer-{$GLOBALS[‘hook_suffix’]}

do_action( "admin_footer-{$GLOBALS[‘hook_suffix’]}", string $hook_suffix )操作挂钩:在默认页脚脚本之后打印脚本或数据。Action Hook: Print scripts or data after the default footer scripts.目录锚点:#说明#参数#源码说明(Description)钩子名的动态部分,$GLOBALS['hook_suffix']引用当前页的全局钩子后缀。参数(Parameters)参数类...

日期:2020-09-02 17:44:20 浏览:1071

customize_save_{$this->id_data[‘base’]}

do_action( "customize_save_{$this->id_data[‘base’]}", WP_Customize_Setting $this )动作钩子::在调用WP_Customize_Setting::save()方法时激发。Action Hook: Fires when the WP_Customize_Setting::save() method is called.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_data...

日期:2020-08-15 15:47:24 浏览:809

customize_value_{$this->id_data[‘base’]}

apply_filters( "customize_value_{$this->id_data[‘base’]}", mixed $default )过滤器::过滤未作为主题模式或选项处理的自定义设置值。Filter Hook: Filter a Customize setting value not handled as a theme_mod or option.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_date['base'],指的是设置...

日期:2020-08-15 15:47:24 浏览:900

get_comment_author_url

过滤钩子:过滤评论作者的URL。Filter Hook: Filters the comment author’s URL.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/comment-template.php:32610...

日期:2020-08-10 23:06:14 浏览:931

network_admin_edit_{$_GET[‘action’]}

do_action( "network_admin_edit_{$_GET[‘action’]}" )操作挂钩:启动请求的处理程序操作。Action Hook: Fires the requested handler action.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$u GET['action']引用请求的操作的名称。源码(Source)更新版本源码位置使用被使用3.1.0 wp-admin/network/edit.php:3600...

日期:2020-08-02 09:56:09 浏览:879

network_sites_updated_message_{$_GET[‘updated’]}

apply_filters( "network_sites_updated_message_{$_GET[‘updated’]}", string $msg )筛选器挂钩:在网络管理中筛选特定的非默认站点更新消息。Filter Hook: Filters a specific, non-default site-updated message in the Network admin.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分$_GET['updated']引用了非默认的...

日期:2020-08-02 09:56:03 浏览:865

pre_wp_is_site_initialized

过滤器::过滤在访问数据库之前是否初始化站点的检查。Filter Hook: Filters the check for whether a site is initialized before the database is accessed.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/ms-site.php:93910...

日期:2020-07-29 10:15:38 浏览:834

WordPress 的SEO 教学:如何在网站中加入关键字(Meta Keywords)与Meta 描述(Meta Description)?

你想在WordPress 中添加关键字和meta 描述吗?关键字和meta 描述使你能够提高网站的SEO。在本文中,我们将向你展示如何在WordPress 中正确添加关键字和meta 描述。为什么要在WordPress 中添加关键字和Meta 描述?关键字和说明让搜寻引擎更了解您的帖子和页面的内容。关键词是人们寻找您发布的内容时,可能会搜索的重要词语或片语。而Meta Description则是对你的页面和文章的简要描述。如果你想要了解更多关于中继标签的资讯,可以参考Google的说明。Meta 关键字和描...

日期:2020-10-03 21:18:25 浏览:1734

谷歌的SEO是什么

SEO (Search Engine Optimization)中文是搜寻引擎最佳化,意思近于「关键字自然排序」、「网站排名优化」。简言之,SEO是以搜索引擎(如Google、Bing)为曝光媒体的行销手法。例如搜寻「wordpress教学」,会看到本站的「WordPress教学:12个课程…」排行Google第一:关键字:wordpress教学、wordpress课程…若搜寻「网站架设」,则会看到另一个网页排名第1:关键字:网站架设、架站…以上两个网页,每月从搜寻引擎导入自然流量,达2万4千:每月「有机搜...

日期:2020-10-30 17:23:57 浏览:1309