Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (529)
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  
  Clipping in Orthographics projection  (Read 4705 times)
0 Members and 1 Guest are viewing this topic.
Offline khangharoth

Junior Member




There is more to life than JAVA...But Java Rocks


« Posted 2006-12-21 07:53:58 »

Hi i am trying to clip in Orthographic projection.
 In Jogl its done something like this  gl.glOrtho(0.0f,3.0f,   0.0f,3.0f,   -10f,5f);

In xith i thought  in method  calculatePerspective(Canvas3D canvas)  of  View class when its setting projection Matrix with
orthoMesa   it sets the ClippingVolume.

Also while calling this particular method in View.java
1  
2  
// TODO Check for the correct frontClipDistance calculation for this projection. This is known that current use of -backClipDistance is ugly and wrong, and better way for //this calculation needed
       projection.orthoMesa(-screenScale, screenScale, -screenScale*canvasHalfHeight, screenScale*canvasHalfHeight,-backClipDistance, backClipDistance);    


Here if  i don't supply balance parameters like for  left,  right  say i supply  0,10  than perspective gets totally disoriented. Why this restriction of specifying
all the three pairs in equal and opposite values.
 
I checked out that the method  orthoMesa of Transform3D its same as of  Java3D   ,so is that means we are not properly multiplying  ModelViewMatrix and Projection matrix .

Also is their any other way to take  a 2D image of a scene formed by intersection of    A Scene And a Plane Specified .

Note  : I am trying to write a small CAD Application with help of  Xith . So you can Guess why i am working in Orthographic projection.

Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #1 - Posted 2006-12-21 12:56:04 »

Clipping is done in two situations in OpenGL (correct me, if I'm saying bullshit):

  • If a Polygon is totally or partly out of the frustum
  • if a scrissor box is defined by glScissor()

The second one is abstracted by the ScissorBox class in Xith3D. User the setScissorBox() method of Groups and all Shapes inside this group will be clipped by this box.

Marvin
Offline khangharoth

Junior Member




There is more to life than JAVA...But Java Rocks


« Reply #2 - Posted 2006-12-21 13:34:34 »

You are absolutely right .
In my problem i want to create a frustum in such a way that i can take a 2D view which is generated by intersection of Scene with specified Plane.

Thanks for pointing out ScissorBox class, will go trough it.It will give me a direction to think about  Cool

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.

ctomni231 (31 views)
2014-07-18 06:55:21

Zero Volt (27 views)
2014-07-17 23:47:54

danieldean (23 views)
2014-07-17 23:41:23

MustardPeter (24 views)
2014-07-16 23:30:00

Cero (39 views)
2014-07-16 00:42:17

Riven (41 views)
2014-07-14 18:02:53

OpenGLShaders (28 views)
2014-07-14 16:23:47

Riven (28 views)
2014-07-14 11:51:35

quew8 (25 views)
2014-07-13 13:57:52

SHC (61 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!