[x3d-public] view3dscene controls and displays
Michalis Kamburelis
michalis.kambi at gmail.com
Wed Jun 21 14:32:15 PDT 2023
Hi,
Thanks for the good words!
1. As for camera direction displayed in view3dscene:
It is a direction vector, that is: a 3D vector along which the
camera looks. E.g. (1,0,0) means camera looks in the direction of +X,
i.e. positive X axis. It is always normalized (length = 1).
It is indeed a different representation than X3D orientation
(though can be converted both ways between direction/up and
orientation, CGE does it).
I chose to show it this way, because it is more widely understood
by people outside of X3D. It is consistent with CGE internal
TCastleCamera (actually TCastleTransform) vector "Direction". It is
also consistent with how I found 3D programmers in general need it,
e.g. in Unity you'd write "Camera.main.transform.forward". Allows you
to write in CGE code like "Camera.Translation := Camera.Translation +
Speed * Camera.Direction" to move forward.
In contrast, X3D orientation is an axis+angle rotation relative to
the default direction, −Z. To understand such orientation, the human
has to remember that default is -Z. And to express simple directions
(like "look in +X") one needs to do rotations by pi/2, which don't
look so obvious when displayed as floats on status bar.
Ultimately, it is a matter of taste "what looks more obvious". I
found the 3D direction vector more readable to humans than the X3D
orientation.
Note that you can always use "Clipboard -> Print Current Camera
(Viewpoint) ..." to see the X3D orientation corresponding to the
current direction. I know it's not the same --- it's not visible in
the status all the time. But it is available.
2. "File -> Reopen" -- It does open the file again, reloading it from
disk (or any URL, in general).
I routinely use it while editing -- I do some edits in text editor,
Alt+Tab to view3dscene, use "File -> Reload", and it loads the new
(edited) version of the file. It *does not* just reinitialize the
model from the memory.
If you experience something else, please describe in more details
how it happens. (And let me know which exactly version you use, e.g.
snapshot or stable from https://castle-engine.io/view3dscene.php ).
3. "Phong Shading on Everything" is actually more correct. E.g. it
multiplies the diffuse color by diffuse texture only.
If you believe otherwise, please post a testcase. But in general,
while "Phong Shading on Everything" on / off indeed makes a
difference, the value "on" is exactly what X3D specification says (and
it is more flexible). The value "off" is a result of necessary
limitations of Gouraud shading. For physical-based rendering (PBR) in
PhysicalMaterial, the Phong shading is actually the only sensible
(Gouraud shading + PBR is theoretically possible but nobody uses
that).
Note that you can use "Shape.shading" (CGE extension) to
specifically request given shading on given shape, to force Gouraud
shading you would use shading="GOURAUD".
Regards,
Michalis
śr., 21 cze 2023 o 21:33 Joseph D Williams <joedwil at earthlink.net> napisał(a):
>
>
>
> Hey, Thanks, view3dscene is working better all the time but some simple convenience factors for x3d are well, missing.
>
>
>
> For example, in the View, Status and Toolbar, the Camera pos and dir are given.
>
> The pos (position) is given in correct units but the dir is given as x y z (Euler?) angles.
>
> Please at least give an option to read dir the as ori (orientation) since x3d does not deal in those x y z units. So at least an option to present axis-angle or even unit quaternions is needed. This would make the “Camera” display useful for x3d authoring and so I really would like to read that camera position (in current coordinate space) and orientation in axis-angle directly. And, under Navigation this view feature is given as Viewpoint.
>
>
>
> In File Reopen, it appears to do just that, reopen (or rerun) the same file it has last loaded, not go out and get a new version of the file and reload that. Sorry, I misinterpreted a couple of times before I figured it out and just used Open again to reload and run the file. I can’t think of a time that there was some kind of problem where I just wanted to rerun what is in memory, especially since you have given good animation timing controls. Most times just want to fix the input and reload the thing.
>
>
>
> In View, Phong Shading on Everything as default makes stuff look a lot different than routine.
>
> Maybe there are some settings I am missing but for most stuffs Phong off seems to work more as expected and I really would like to read that camera orientation.
>
>
>
> Thanks and Best Regards,
>
> Joe
>
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
More information about the x3d-public
mailing list