Exploring Portals in ThreeJs

Hey, has anyone successfully created a portal effect in ThreeJS?

I'm interested in experimenting with impossible architectural designs for my VR thesis. Specifically, I'm attempting to construct a small square house where looking through the door reveals an impossibly large hallway that defies spatial logic.

My approach involves creating a 'portal' on the door that links to another scene. I've tried rendering a camera onto a texture, similar to the example provided here ( ), and using .setViewOffset to manipulate the view, but I'm running into complications and feeling a bit overwhelmed.

Any guidance or assistance would be greatly appreciated. You can check out my current progress at .

Answer №1

I just wanted to mention that I used the camera to texture demo from Stemkoski to render the portals as well.

Although I'm not sure exactly what issue you're facing or what you've encountered, I want to assure you that it is possible to solve:

Furthermore, the portals are functioning correctly and successfully teleporting the player :)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

js simulate a click on an anchor element based on the child element's id

I am trying to automatically trigger a click on an a tag that contains a div with the id='a'. $(document).ready(function() { $("#chat_list_content a:has(div[id='a'])").click(); //$("#chat_list_content a:has(div[id='a']) ...

Steps for adjusting the length in the getRangeLabel function of mat paginator

@Injectable() export class MyCustomPaginatorIntl extends MatPaginatorIntl { public getRangeLabel = (page: number, pageSize: number, length: number): string => { if (length === 0 || pageSize === 0) { return `${ ...

The function WebGLRenderer() from three.js allows for rendering in

When initializing the WebGLRenderer, I am passing in a canvas DOM element like shown below: var jqc = $('#myCanvas'); //accessing canvas with jQuery; var par = {canvas:jqc.get()}; //creating parameter object with canvas DOM element var renderer ...

What is the process for importing a JavaScript file into a Vue component?

Having trouble importing JSON results into a Vue component? The results are as follows: [{"id":"d023c5e3-ca3c-4d97-933a-1112a8516eee", "score":9001, "updated":"2018-12-07T13:48:33.6366278", "player":Johanna, "category":Funny}, {"id":"398b65fb-e741-4801-b ...

PHP variables that are constantly changing

I recently developed a website that showcases random entries from a database to viewers. Here is the current code snippet I am using: $records = "SELECT * FROM xxx"; $records_query = mysql_query($records); $num_records = mysql_num_rows($records_query); $i ...

What could be the reason for the issue `injection "store" not found` showing up when attempting to call `this.store.commit()`?

I am currently working on storing values with VueX, specifically using Vuex 4.0 instead of the older version 3.0. While attempting to commit a value, I encountered an issue as follows: ... this.$store.commit("changerusername", u) ... To addres ...

Enhancing User Experience with Bootstrap V5 Form Validation and Sweetalert2: Displaying a Message of Success Upon Successful Submission

I am currently working on implementing a simple form using Bootstrap 5 that includes validation. My goal is to display an alert message when the form field is successfully submitted using Sweetalert2. Below is the code I have: HTML <form action=&q ...

Issue with EnumDeserializer in jackson-mapper 1.9.12 version

I'm currently working on a scenario where I need to map a String to an enum Object using the Jackson ObjectMapper.readValue(String,Class) API. The issue arises when my JSON string contains a Task Object with an Action enum defined as follows: public ...

What is the best way to limit the character display to a maximum of 30 in Vue.js?

My current goal involves achieving the following task. In a certain variable, I currently have this text: let text = 'hey this is a super long phrase' I am looking to utilize a label to showcase the text, but with only a limited number of char ...

Implementing a user registration popup form with AJAX in Yii framework

I am currently utilizing the Yii-user extension for user registration, and it is working perfectly fine. However, my requirement is to display the registration form using ajax on pages that have a menu item for registration. I do not want the user to be re ...

Tips for organizing the output of items from the .getJSON method

I am currently facing an issue where my output is displayed on the page in the same order as the raw JSON file. I am seeking assistance on how to sort the items based on a specific property within each item. For instance, I would like to sort alphabetical ...

What is the best way to format a date as "2020-01-16 07:29:43.657519000 Z" using JavaScript?

Upon discovering a format 2020-01-16 07:29:43.657519000 Z in a project, I am curious about the significance of the numbers 657519000 and how to replicate this precise format using JavaScript. When attempting new Date().toISOString(), I receive 2020-05-27T2 ...

Vue.js not populating select option tags

I've encountered an issue with my profie.html code that is intended to display division dropdown values using vue.js v-for and {{ val.division_name }}. However, the dropdown is rendering blank values even though there are supposed to be values present ...

Achieve maximum height with background images

Having trouble with responsiveness on my box containing a background image. I am aiming for the box to adjust its height based on the background image, as I have set the background-size attribute to auto. html: <div class="index_boxs" id="discover_win ...

Merging values of different keys in a .json file

Check out my json file below: { "foo": "https://3a1821d0.ngrok.io/api/foo", "bar": "https://3a1821d0.ngrok.io/api/bar", } I am interested in changing the key 3a1821d0 to a different variable within the json structure, like so: { "some_variab ...

What is the best way to save a token value to a JavaScript file on my local storage

Hello, I am new to Nodejs and have implemented passportjs token-based authentication. When a user logs in, a token is provided for each user. Now, I want to perform certain operations based on the users who have token values. For example, if a user wants t ...

Issues arise in the alignment of the tab order when utilizing a combination of the stripe card

Experiencing an issue with tab index not working properly when using Vue.js and having a stripe card-element inside the Vue main element. Below is the code snippet: <html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js ...

Guide to generating a dynamic manifest.json file for Progressive Web Apps using ReactJS

I am working on a project that requires me to generate a dynamic manifest.json file for my PWA (ReactJS). Below are the relevant code snippets: app.service.js: function fetchAppData() { const requestOptions = { method ...

Combining ImmutableJS Records

I've encountered an issue when trying to add a new property to an imported immutable record before using it as the default state for my application. Despite attempting methods like merge, mergeDeep, mergeWith, and mergeDeepWith, I wasn't able to ...

Styling material-ui textfield: Tips and tricks

I've been grappling with figuring out how to customize a material-ui TextField component. <TextField id="email" label="Email" className={classes.textField} value={this.state.form_email} onChange={this.handle_change('form_e ...