Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

3d Theory. vcs to scs transformation.

843799Aug 14 2001 — edited Aug 17 2001
Hi you 3d gurus.
Please give me a tip!

If you have a point with coordinates given in the View Coordinate System, how do you translate it to a point on the screen?
The point is given by x,y,z in the view coordinate system (vcs). (x is horizontal, y is vertical, and z is distance stright forward from your eye.)
To obtain where to render the point at the screen, I could do something like this:
iScreenX = (400*vcs.x)/vcs.z;
iScreenY = (400*vcs.y)/vcs.z;
The problem is that this only works for z values grather than 0.
if(vcs.z <= 0)
IHaveAProblem();
Ofcorse, a point with negative (or zero) z- value shold not be shown, however, a polygon might be visible even though one of its vertexes has a negative z- value. Havent found any good solution. So far, I just dont paint the polygon at all if I find a negative or zero z.
I also tried using the distance, and not the z- value as the divisor:
double dDivisor;
dDivisor = Math.sqrt(vcs.x*vcs.x +vcs.y*vcs.y +vcs.z*vcs.z);
iScreenX = (400*vcs.x) / dDivisor;
iScreenY = (400*vcs.y) / dDivisor;
This is ok for all points not beeing positioned in the middle of your eye (givig dDivisor=0), but it gives a fisheye like view of the world, and thats not exactly what I want.

I want something close to the first solution, but that also works on negative and 0 z values.

Anybody knows?

This is my 3d engine:
http://blake.prohosting.com/ragnvald/

";-)
Ragnvald Barth
Software engineer

Comments

Need more details, including the Forms and DB versions you are using.
Are you using Forms blocks based on DB (i.e. "Data Blocks") or you are executing your own DML and populating (and altering) fields or both? And, how are you "committing" (COMMIT_FORM, or Save button or something else)? Be specific; if you are executing the "COMMIT" - are you using COMMIT or COMMIT_FORM?

MarcLaf

Using Oracle Forms 12c and Oracle DB 19. Yes, I'm using data blocks, based on tables from DB. User clicks a button to save and I'm doing a COMMIT_FORM.
Thanks,
Marc L

MarcLaf

Here's part of my Key-Commit code:
image.pngMarc L

Hmmm - If you are using a true "data block", there is often little reason to execute your own POST. Forms will do this automatically as soon as a the first change is made. This will result in a record lock. I'm not saying that doing a POST (or COMMIT_FORM) is a bad thing. I'm just saying that in a block managed by Forms, most of the "right" processing will happen automatically (a benefit of using Forms).
To your question, I have not tested, but suspect the behavior based on your description of what you are doing, is correct. Validation must occur upon POSTing, but also again when COMMITing. If you look at the Builder Help related to POST and COMMIT_FORM you will see that it supports this belief.
If you wanted to continue on this path, it might help to change the Validation Unit property (form level), as this might offer some relief. Of course doing this could also change the desired behavior of something else. Again, check the Builder Help for details on this property.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 14 2001
Added on Aug 14 2001
7 comments
208 views