Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 1246 times)
0 Members and 1 Guest are viewing this topic.
Offline Wizumwalt

Junior Devvie

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!
Pages: [1]
  ignore  |  Print  

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

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

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

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

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

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

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

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

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

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!