Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  LOD tactics  (Read 814 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Member




Java games rock!


« Posted 2003-11-17 20:14:50 »

Im trying some LOD techniques. One of the techniques requires the existence of multiple 3d models for the same object. But to know how many models are required i need to know a few things.
One is to able to calculate the size of a pixel in the view plane. Lets say that field of view is 45 degress, the plane distance is 1000 meters and the screen resolution is 800x600 pixels. How do i know the size of the pixel in meters ?

Another technique requires replacing an individual object by a flat image. What variables do i have to look at to know when to replace a 3d object with a flat image representation ?

Another technique is to palce a group of objects in something like a "system". This technique is the only one im considering for deleting and adding objects to a scene dynamically. Lets say i have a set of objetcs for a group of birds. When this group of birds is seen faraway the system contains less objects. As anyone done anything similar to this ?
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #1 - Posted 2003-11-17 21:51:42 »

Quote
One is to able to calculate the size of a pixel in the view plane. Lets say that field of view is 45 degress, the plane distance is 1000 meters and the screen resolution is 800x600 pixels. How do i know the size of the pixel in meters ?

Trigonometry.  Field of view is 45 degrees = 800 pixels.  Half the screen is 22.5 degrees = 400 pixels.  By trig, 1000 tan 22.5 = 414.21 metres, which we know is 400 pixels, so each pixel is 1.04 metres in width.  If your aspect ratio is correct, the height will be the same.

So: (distanceToPlane * tan(fov / 2)) / (horizontalResolution / 2) = visible width of pixel in metres.

Quote
Another technique requires replacing an individual object by a flat image. What variables do i have to look at to know when to replace a 3d object with a flat image representation ?

When to replace it?  Depends on the application, surely?  Just pick a distance that seems "reasonable" in your coordinate system and try it.  If it looks too close, push it back.  If you don't notice it, pull it forward until you do, then push it back a little. Grin

Hellomynameis Charlie Dobbie.
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #2 - Posted 2003-11-18 04:50:47 »

urgs - I just used Java3Ds LOD behavior ..... too simple??

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zingbat

Senior Member




Java games rock!


« Reply #3 - Posted 2003-11-18 19:04:14 »

Quote

Trigonometry.  Field of view is 45 degrees = 800 pixels.  Half the screen is 22.5 degrees = 400 pixels.  By trig, 1000 tan 22.5 = 414.21 metres, which we know is 400 pixels, so each pixel is 1.04 metres in width.  If your aspect ratio is correct, the height will be the same.

So: (distanceToPlane * tan(fov / 2)) / (horizontalResolution / 2) = visible width of pixel in metres.


I think your solution works. I realize now that i needed some more information to extimate the LOD geometry to use.

The problem is how to compute the distance in pixels between two points (wherever they are) when projected in the view plane. Suposing the info related to fov and the view plane distance is the same as in post above. How can we solve this ?

Im thinking in calculating the he distances between two extreme points in the bounding box of an object. Then based on the distance between the two in pixels i would choose what LOD geometry to use.

For instance if an object is going to be projected in a rectangular region of 10x10 pixels on the screen i would probably choose a LOD geometry with at most 10 vertices wide and 10 vertices equaly distributed.

Or i would use a flat image. Which probably would be a much better solution if the object is far enough and considering it is only 10x10 pixels. Just what are the known problems on using flats to replace geometry ?
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (21 views)
2014-09-19 03:14:18

Dwinin (35 views)
2014-09-12 09:08:26

Norakomi (62 views)
2014-09-10 13:57:51

TehJavaDev (87 views)
2014-09-10 06:39:09

Tekkerue (42 views)
2014-09-09 02:24:56

mitcheeb (65 views)
2014-09-08 06:06:29

BurntPizza (47 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (40 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!