Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (854)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  print game screen like vr games  (Read 1835 times)
0 Members and 1 Guest are viewing this topic.
Offline pavul

Junior Devvie


Medals: 4
Exp: 4 years



« Posted 2017-08-02 02:52:45 »

how can i split the screen in two, using awt.canvas ?, i mean instead to print the screen in the whole area i would like to print that same twice like vr games.

its better not know why it works, that know why is not working
Offline KevinWorkman

« JGO Plugged Duke »


Medals: 285
Projects: 12
Exp: 12 years


HappyCoding.io - Coding Tutorials!


« Reply #1 - Posted 2017-08-03 02:56:32 »

Like most things in programming, there are about a hundred different ways to do this, and which way is right for you depends more on you than anything. So the best thing you can do is researching and trying things out.

Two approaches occur to me:

Approach one: just draw stuff twice.
Approach two: draw to a buffer, and then draw that buffer twice.

There are probably other ways to do this, and Google should really be your first stop for questions like this. Also note that VR games aren't just drawing the same thing twice; they're drawing the same scene from slightly different angles.

HappyCoding.io - Coding Tutorials!
Happy Coding forum - Come say hello!
Offline pavul

Junior Devvie


Medals: 4
Exp: 4 years



« Reply #2 - Posted 2017-08-03 13:32:22 »

thanks for your answer, i googled but i could not fin anything useful thats what im asking here, some times i would appreciate to pleople respond only what posters are asking, sometimes, if somebody is asking its because does not have any single idea of what to do, and u say google it, yes thats true but if u dont know a cat you wont realize it just passed one before you a moment ago.

but thanks man i appreciate your answer, however, do you have an idea of how draw buffer twice?

PD: when i googled, there is how to create VR but for android, not for Java SE

its better not know why it works, that know why is not working
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Phased
« Reply #3 - Posted 2017-08-04 05:08:44 »

Download LWJGL3, make sure you get the OpenVR or OVR bindings.

1) Get the left eye view matrix from the headset
2) Render the scene using the left eye view matrix
3) Pass the texture buffer to the headsets left eye
4) Get the right eye view matrix from the headset
5) Render the scene using the right eye view matrix
6) Pass the texture buffer to the headsets right eye
7) If its OpenVR, update the HMD matrix pose, if OVR, find the equivalent function.
Offline KevinWorkman

« JGO Plugged Duke »


Medals: 285
Projects: 12
Exp: 12 years


HappyCoding.io - Coding Tutorials!


« Reply #4 - Posted 2017-08-05 18:13:58 »

when i googled, there is how to create VR but for android, not for Java SE

You need to break your problem down into smaller steps and then approach those steps one at a time. Something like "vr Java" is way too broad, so you aren't going to find anything very useful with that.

You've already narrowed it down to a step of drawing the same scene twice (with the caveat that that's not how VR works). And you've been given a couple of approaches for how to tackle that. Have you tried googling that? Something like "java swing buffer" will return a bunch of results, and you can use those results to refine your approach. Then if you get stuck, you can come back here with a specific question and a small example program that shows us exactly what you're trying to do. Good luck.

HappyCoding.io - Coding Tutorials!
Happy Coding forum - Come say hello!
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1328 views)
2018-06-10 19:43:48

EgonOlsen (1205 views)
2018-06-10 19:43:44

EgonOlsen (929 views)
2018-06-10 19:43:20

DesertCoockie (1354 views)
2018-05-13 18:23:11

nelsongames (1110 views)
2018-04-24 18:15:36

nelsongames (1359 views)
2018-04-24 18:14:32

ivj94 (2094 views)
2018-03-24 14:47:39

ivj94 (1251 views)
2018-03-24 14:46:31

ivj94 (2249 views)
2018-03-24 14:43:53

Solater (803 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!