ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator webgl platform help
person icon
ArchAngel
Guest
Quote
2025-02-15 03:57:15

Does anyone know of a way to have two active cameras for coppercube webgl game? Any working splitscreen methods for the platform? If i can get two cameras running i can have Webxr support for the platform in no time. thanks!

person icon
bob
Guest
Quote
2025-02-15 04:33:52

can i get a shekel first?

person icon
ArchAngel
Guest
Quote
2025-02-15 05:51:30

Serious replys only please, working hard at getting the community full webxr support. It is currently working with a published coppercube html.

person icon
smokeyoke
Registered User
Quote
2025-02-15 14:46:56

I don't think there is a clean way of doing that without modifying source copperlicht code.

If you're making a simple scene, what you can do though is use two ccbz files like:
<script type="text/javascript">
<!--
startCopperLichtFromFile('3darea', 'copperlichtdata/lll.ccbz', ...;
startCopperLichtFromFile('3darea2', 'copperlichtdata/lll1.ccbz', ...;
-->
</script>

And two canvas elements correspondingly:
	<div align="center">
<canvas id="3darea" width="800" height="600" style="background-color:000000">
</canvas>
<canvas id="3darea2" width="800" height="600" style="background-color:000000">
</canvas>
</div>

You build one file to be sort of "primary" frame, there all game logic happens, second is "secondary" which has the same assets, same everything but no logic at all, you copy nodes positions, scales, rotations, animations and other parameters from primary file instead. I never tried that, but I believe canvas gets updated even if it's not in focus, so potentially it should work.

person icon
ArchAngel
Guest
Quote
2025-02-15 16:27:30

I appreciate your reply Smoke, but unfortunately it won’t work because then there would be two different gl contexts and the webxr session can only use one and one canvas. Need some way to mirror the right vr eye onto the left eye.

person icon
smokeyoke
Registered User
Quote
2025-02-15 17:12:49

I see. Unfortunately, I don't know much about webxr. Have you tried to download and modify CopperLicht to support it?

person icon
ArchAngel
Guest
Quote
2025-02-15 17:29:59

Yes, thats what i am currently doing. Ive added a lot but ijust dont know what to change specifically that will allow two cameras or allow the engine to renderer twice once for each eye. really just stuck there i can handle headset tracking and motion controllers input, but im just only stuck because it just reanders to the right eye. It does clear the buffer for the left and sets the background color for it, but the actual scene only renders to the right or to just the left vice versa.

person icon
ArchAngel
Guest
Quote
2025-02-15 20:25:44

So I got them both to render now but again one small issue is they are at two slightly different angles which causes the scene not to line up correctly and Im seeing double. But im working on it.

person icon
bob
Guest
Quote
2025-02-16 02:14:31

And nothing else matters...


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |