Forum Replies Created
-
AuthorPosts
-
scatman2513Participant
Thank you a lot @kdv. The issue is fixed now. After calling the render function nearly 100 times I always get the same numbers now in the performance info and the fps-drops have stopped now. Fantastic! Made my day = )
scatman2513ParticipantThis worked perfect. Thanks. Now I can duplicate and delete objects and “Geometry Buffers” isn’t growing anymore.
However, in my application (not the demo project I shared above) I still have performance issues and a look into the performance info shows me that “Textures & Render Buffers” is still growing. I also have these “N/A Textures” calculating up.
I tried to change your code to delete materials first but it had no effect..
VARS.allDupedObjects.forEach(function(name){ const object = app.scene.getObjectByName(name); if (object && object.isMesh){ object.material.dispose(); object.geometry.dispose(); } });
Do you know what’s the problem here?
If you need a demo application I could create one end of the week.best regards
Attachments:
You must be logged in to view attached files.scatman2513ParticipantIt took me a moment to create a demonstration application for my problem. I’ve attached the .zip into my post. I have to say that I’m working with a plugin from gliftek to duplicate my objects.
The logic is built into the puzzle. If you take a look into the console output, then you can see how Gemoetry Buffers is growing while objects stay the same.Attachments:
You must be logged in to view attached files.2022-12-06 at 8:20 am in reply to: [set style] – Choose pointer-events and html .class selector #58857scatman2513Participantsure, you can do this using this puzzle: https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#query_selector
Doesnt it only return the first found element or is it possible to select all elements from a class?
scatman2513ParticipantThank you @kdv77kdv for your fast reply.
I created a new Verge project with the cube and pasted the code into the runCode(app) function, but the zoom function behaves differently than before. When I zoom out the background also changes and not only the cube which gets smaller.
Did I do something wrong?
Here is how I inserted it:function runCode(app) { var obj = app.scene.getObjectByName('persp1'); //scene camera app.controls.enableZoom = false; let zoom = obj.zoom; const elem = document.getElementById('v3d-container'); elem.addEventListener('wheel', function() { event.preventDefault(); zoom = obj.zoom - event.deltaY * 0.00075; obj.zoom = v3d.MathUtils.clamp(zoom, 0.1, 10); obj.updateProjectionMatrix(); }, false); }
(sorry for other account, using this one for the office and had no access at home)
Edit:
I have now tested the zoom function on my real project. Since I have no details in the background but only a color gradient it is not that noticeable and I can already work with it.2022-08-29 at 3:37 pm in reply to: extract position data for panning an object (default cube) #55342scatman2513ParticipantYou should also read and transmit the position of orbitTarget while panning.
That solved my issue. Now its working for all movements with
orbitTarget
. Thanks a lot!2022-07-26 at 4:25 pm in reply to: extract position data for panning an object (default cube) #54421scatman2513ParticipantYeah, I mean you can see that the x/y/z position of the scene camera is being transmitted without any problems. This has nothing to do with SocketIO.
I can even simulate this without sockets.io :
1. Log x/y/z position of scene camera without moving it (default position). I get the values 4.05/3.03/4.05
2. hold the middle mouse button (mouse wheel) and drag the object out of my view.
3. Log x/y/z position of scene camera. I get the values 0.64 / 2.75 / 7.67
4. Now create a puzzle and set the position of the scene camera to 0.64 / 2.75 / 7.67 after 5 seconds.
5. See the result. The Cube is still in the middle of the window and is not out of the window as it should be.
2022-07-26 at 3:47 pm in reply to: extract position data for panning an object (default cube) #54419scatman2513ParticipantThe problem is that the panning (holding middle / right mouse button and move the mouse) isnt transmitted to the other clients.
The second code block to catch the mouse button is just a temporary code block, you can ignore it. It shouldnt be relevant to the problem itself.
2022-07-26 at 12:42 pm in reply to: extract position data for panning an object (default cube) #54407scatman2513ParticipantThats what im trying to do right now.
First im binding the object ‘persp1’ to a variable
var obj = app.scene.getObjectByName('persp1');
On Movement i’m sending the position data (XYZ) of the scene camera to the server
var x = obj.position.x;
The server sends it to all clients and the client will use these position data for the scene camera
obj.position.x = pos.x;
Edit:
Cant attach my project because its 4.95MB as compressed archive.Edit2:
7zip did the job. Just open the same room like i.e. http://localhost:3000/?room=test (nodeJS required)2022-07-26 at 8:44 am in reply to: extract position data for panning an object (default cube) #54400scatman2513ParticipantIs there a way to give the information about the panning position to other players? Panning is kind of required for my project. I thought ‘persp1’ is the scene camera.
scatman2513ParticipantHi Yuri, thanks for your fast reply.
You’re right, with the procedures I can then add & bind the event-listeners once I’ve reloaded the content with Ajax. Now its working.
Thanks a lot!
-
AuthorPosts