Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (781)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
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  
  [HELP] 3D Programming in pure java.  (Read 341 times)
0 Members and 1 Guest are viewing this topic.
Offline codyorr5

Senior Newbie


Medals: 1



« Posted 2019-02-07 07:28:11 »

Hey, guys i've recently created a 3D engine in pure java. (pure java meaning i didn't use Java3D, lwjgl, etc) that currently views a cube and its convenient for me (simply create a model, vertex list and face list then add both list to the model, then simply render the model), although it does not contain any parser's yet. (so i can load .obj models and other 3d model file formats)

UPDATE: you may now download my source/app to check this out for your self.



THE ISSUE:

It shows a perfect CUBE when the cube is centered within the camera...
BUT as you move the camera and the cube becomes closer to the edge of cameras view, some of the faces appear to change into rectangles (like the cube stretches) so the problem is my math i guess? i was hoping someone would have stomped this challenge before and have some good tips.

thanks for any help, i'll post pics if needed.





CUBE CENTERED

http://prntscr.com/mhsr7e


Cube moved to the end of the camera.

http://prntscr.com/mhss0i



Better Cube Example

https://i.imgur.com/eGdZaq4.gif





DOWNLOADS:

Source Code: https://www.dropbox.com/s/z2xltl9tyw6h39x/3DLibrary.rar?dl=0

Runnable Jar: https://www.dropbox.com/s/duy8nif69a32re5/3DTest.jar?dl=0

Offline Archive
« Reply #1 - Posted 2019-02-07 07:40:50 »

Yeah post pictures, sounds like normal perspective distortion though

Offline codyorr5

Senior Newbie


Medals: 1



« Reply #2 - Posted 2019-02-07 09:36:22 »

perspective distortion huh? im fairly new to all this so i wouldn't know but that is something for me to look into.

I've also added 2 pictures and a GIF of my issue, thanks for the reply.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 1064
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2019-02-07 11:36:37 »

Perfectly normal... you've got a really wide field-of-view for your camera which distorts things heavily towards the edges. If you had a real mathematical camera model with a raytracer you'd even see the edges of the cube curve instead of being straight lines.

To minimise the effect, move the camera further away from the cube, and shrink the field of view, which gives a more telephoto sort of shot.

Cas Smiley

Offline codyorr5

Senior Newbie


Medals: 1



« Reply #4 - Posted 2019-02-07 23:29:09 »

Thank you for the reply man, i will play around with those two factors a bit.


UPDATE: i couldn't get it down :C, maybe ill check out some tutorials on FOV.
Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (1177 views)
2018-11-16 13:46:03

hadezbladez (531 views)
2018-11-16 13:41:33

hadezbladez (1190 views)
2018-11-16 13:35:35

hadezbladez (274 views)
2018-11-16 13:32:03

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

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

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

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

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

nelsongames (2817 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

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
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!