Is there a way to translate estimated coordinates from a Revit model into Viewer coordinates in order to accurately place a three.js object within the Viewer?
Is there a way to translate estimated coordinates from a Revit model into Viewer coordinates in order to accurately place a three.js object within the Viewer?
To prevent coordinate floating issues, Forge viewer automatically applies a global offset to the loaded model. Therefore, when working with your own three.js object in the Revit space, remember to subtract this offset from the object's coordinates.
// Obtain the global offset
const globalOffset = viewer.model.getData().globalOffset;
const ptInRvt = new THREE.Vector3(10, 5, 0);
// Apply the offset
const offsetPt = ptInRvt.clone().sub(globalOffset);
If for any reason your global offset is zero, you can also make use of the placement offset:
// Placement offset
const offsetMatrix = viewer.model.getData().placementWithOffset;
const ptInRvt = new THREE.Vector3(10, 5, 0);
const offsetPt = ptInRvt.applyMatrix4(offsetMatrix);
I hope this explanation proves helpful.
I have two arrays $array1=('18753933','18753933','18771982') $array2=('18753933','18771982') My goal is to compare the values that are the same in both arrays. var countArticlesLoaded=0; for(var $i=0;$i ...
I have a unique issue with my website structure. I have an 'index' page that dynamically replaces the content of 'mainContents' when any button in the navigation bar is clicked. The purpose of this design is to reload only the necessar ...
My click counter is not sending variables to the server. I have tried finding examples on how to do this, but no matter what I attempt, the data is not being sent to the server. It seems like using AJAX would be the best option, but I must be doing someth ...
While testing the build, everything runs smoothly. However, when attempting to build the distribution, an error is encountered: An error occurred: Cannot find module '/Users/matt.sich/Documents/angularProjects/firstProject/node_modules/grunt-usemin/l ...
My current challenge involves removing only sequential duplicates from a string. For example, in the string "1 2 3 3 2 1", I want to remove one of the consecutive 3's so it becomes "1 2 3 2 1". I thought I had the solution figured out, but when I test ...
I encountered an issue while running expressJS in one of the containers within docker-compose. When I repeatedly refresh the landing page by pressing CMD+R (approximately every 3-4 seconds), it displays an error message "Error: socket hang up" causing the ...
Why is jQuery docment.ready not firing on the second screen, but working fine on the first/initial screen? I also have jQuery Mobile included in the html. Could jQuery Mobile be causing document.ready to not work? I've heard that we should use jQuery ...
I am currently experimenting with the Telerik Kendo diagram in an attempt to create a visual representation. Due to the fact that I am retrieving all shapes and their connections from my database, I encountered an issue where the attributes of my data sour ...
I am facing an issue with my image slider. When I open index.html in a browser offline, the image slider works perfectly. However, when I try to open it on a server (where it takes a long time to load due to images being over 5mb), the slider stops working ...
I need to showcase several 3D objects on my web app within different containers. Currently, I'm creating multiple three.js renderers, each for a separate container. However, I encountered an error message: "WARNING: Too many active WebGL contexts. Old ...
As someone who is just getting started with PHP and Bootstrap, I am running into an issue where the modal doesn't seem to work when triggered using the .modal method. Here is the PHP code I am using: if ($show_login_modal) { echo " <scr ...
Encountering these warnings when running npm dev: <w> [webpack.cache.PackFileCacheStrategy] Restoring pack from /Users/pdeva/code/monorepo/web/app/.next/cache/webpack/client-development.pack failed: TypeError: Cannot read properties of undefined (rea ...
My approach involves consolidating all error messages into one file, where each error is identified by a specific error code. Within my functions/services, when an error occurs, I invoke a function that accepts the error code as an argument and returns an ...
I've been experimenting with a recursive page reload function that looks like this: export const refreshPage = (count)=>{ if (count <= 0){ // window.location.reload(); console.log("blue"); return }else { console.log(& ...
My issue involves a recaptcha and a registration form. Let me share with you a simplified version of a handler: //my_script.js document.getElementById("my_form").onsubmit = function(e) { e.preventDefault(); grecaptcha.execute(); var grecap_resp = g ...
I have been trying to incorporate a calendar control in my code that selects a date and returns it to a text field. It worked perfectly fine on browsers prior to IE 8, but I'm facing issues with IE 9. Can someone help me troubleshoot this problem and ...
I have a form on 100.php that makes an AJAX call to 200.php. <html> <head> <!-- Include the reCAPTCHA API JavaScript library provided by Google --> <script src='https://www.google.com/recaptcha/api.js'></script ...
I recently upgraded to Bootstrap 5 and now my code is not functioning properly. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria- controls="navbarCollaps ...
I am currently developing an admin interface where users have the ability to add a specified number of cells. Each cell contains details such as name, imageURL, and destination link. name imageURL destination link Users can add cells in bulk (starting w ...
My goal is to send an array to my Node/MongoDB server using an AJAX POST request, along with other variables in the body. Check out the client side JS code below: function setupForm(){ $("#add").submit(function(event) { event.preventDefault() ...