Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
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  
  Deciding front and back?  (Read 801 times)
0 Members and 1 Guest are viewing this topic.
Offline Wizumwalt

Junior Member




Java games rock!


« Posted 2006-01-06 20:08:48 »

Hi all,

I'm getting back to a problem I had to set aside. I have two goals in mind when dealing with strips, surfaces with holes, or closed volumes (listed in order of priority).

#1. I want to know the front and back sides of my triangles by color coding.

If I have a sphere with a hole in it, it seems tracing would work fine since, when I get to a triangle that has no connectivity or is just an edge, then I just stop there and not search for an adjacent face. This also seems like it would work fine for strips and closed volumes. I think I'd have a problem with joints (edges of a triangle that have more than 1 connecting edge), but that's ok for now.

#2. I also want to define their regions or volumes.

It seems like calculating the surface normal for each face would give me a front and back of a surface. I've got the surface normal calculation done in my code, but I don't know how to tell what side of a face it's on which *I believe* would give me the front or back side info that I need to color fill my triangles.
I'm also not too sure how to visually display a region or volume other than the selection of a group of elements that relate to that region/volume.


Anyone have advice, or comments on how they handle this or which of these is the better way, or maybe how to do some of this?
Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2006-01-08 04:02:58 »

So I am a touch confused?  Is this a Java3D program?  Your second question sounds like your writing you own renderer.

if it is the latter its a bit off topic here but yes you are correct. Back facing is done by findin g the surface normal.  You then take the dot product v. your view vector.  If the result is positive, its a front face, if the result is negaitve its a back face.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

atombrot (27 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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!