[x3d-public] view3dscene controls and displays

Michalis Kamburelis michalis.kambi at gmail.com
Fri Jun 23 18:59:24 PDT 2023


AD 0 - Displacer - I hear you, :)

  I'd like to support it (in general, anything we miss from X3D
standard is something I'd like to have one day) but it is admittedly
not high on my personal priority list for now. You can read about our
roadmap e.g. on
https://castle-engine.io/wp/2023/06/16/engine-roadmap-see-whats-coming-in-the-future/
, these are on top now.

  If a popular authoring tool, like Blender, would export Displacer
nodes, and so users would start using this node -- this would likely
bump my priority.

  Until then, I'm of course cool to contributions / PRs implementing this.

AD 1 - Note that we show "Direction and Up", not "Angle and Up".

  And I still think this is just more understandable for people. From
Unity, from Castle Game Engine.

  Yes, there are cases when thinking about rotation (so orientation,
axis-angle) is better than thinking about Direction and Up. (Though
ultimately they are interchangeable, that's actually how CGE exposes
them -- setting one Direction/Up sets Rotation and vice versa.)

  But there are cases when thinking about direction is better, as in
"Camera.Translation := Camera.Translation + Speed * Camera.Direction"
I mentioned before. This is a Pascal code, not X3D, there's no
"translation to X3D", CGE has OOP API to operate on many scenes,
viewports etc. similar to other game engines.

  So, sorry, my position on this still stands. I still think that it's
a matter of taste, and I get your view too... But we just have to
choose something and we cannot show everything on the status bar to
satisfy everyone. And I know (because we do it) that both
representations Directon/Up vs Rotation are interchangeable, and I
still think that Direction/Up is more understandable for people. Yes,
it means that we're less "authoring aid for X3D people", but we're
better to people not interested in X3D, that are looking for camera
vectors that are natural to interpret by humans.

AD 2 - "File -> Reopen": Hm, I checked now -- it definitely works OK for me.

  Here's the video: https://youtu.be/tmP1Tw6FvDU .

  Maybe I misunderstand what you do / what do you expect. Can you
record a video of how it fails for you?

  And yes, Alt+Tab is caught by OS, my point was just to switch
between text editor and view3dscene.

  And indeed I meant "File -> Reopen", not "File -> Reload" :)

AD 3 - Phong shading: If you believe version without Phong shading is
at any point better, please send a (preferably some simple) testcase
to judge.

  If there's a bug, and we do not render following X3D lighting
equations, I'd like to fix it naturally. From my knowledge and test,
Phong shading is both much prettier, *and* follows X3D spec better
(e.g. actually multiplying diffuseColor * diffuseTexture).

Regards,
Michalis

sob., 24 cze 2023 o 03:09 Joseph D Williams <joedwil at earthlink.net> napisał(a):
>
> In line.
>
>
>
> From: Michalis Kamburelis
> Sent: Wednesday, June 21, 2023 2:32 PM
> To: Joseph D Williams
> Cc: X3D Graphics public mailing list
> Subject: Re: [x3d-public] view3dscene controls and displays
>
>
>
> Hi,
>
>
>
> Thanks for the good words!
>
>
>
> You are Welcome.
>
> Displacer😊?
>
>
>
> 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).
>
>
>
> Sure, I get that much. Common stuffs for early usage except vrml, x3d.
>
>
>
>   It is indeed a different representation than X3D orientation
>
> (though can be converted both ways between direction/up and
>
> orientation, CGE does it).
>
>
>
> This is for x3d in view3dscene. Is the conversion shown somewhere?
>
>
>
>     I chose to show it this way, because it is more widely understood
>
> by people outside of X3D.
>
>
>
> But I am interested in x3d. Angle and Up may be more understood somewheres but it just doesn’t carry over into other animation needs, so it is  different with no benefit to x3d. The only difference between animating a Joint rotation and a viewpoint orientation is the default z direction. For default Transform you are is sitting on or in the Joint and looking +z. Default Viewpoint orientation and default Transform rotation are facing each other.
>
>
>
> 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.
>
>
>
> Sure, I’ve seen that sort of shortcut. Up is used how? How do you write that in x3d? x3d can also use Script. What x3d code do you get when you use that CGE shortcut?
>
> Using that camera direction and up has some downsides, right? Simple movements only. Certainly Not how you want to handle other types of animation involving rotations.
>
>
>
>    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.
>
>
>
> You display rounded floats for what you show. Yeah, pi/2 = 90 deg. not so obvious(?) but eventually it helps to learn radians.
>
>
>
> Sure, OK. When you use a Viewpoint for an eye in default Humanoid, you yaw pi to gaze +z.
>
> Rotation is different than orientation. The default Transform or Joint faces +z. Whatever, it would be nice to get a useable number from the front panel. What I would be looking for is something understood and usable by users of x3d.
>
> The CGE internal Castle Camera process of angles and up is of no interest, sorry. X3d orientation is the standard for representing viewer pointing and x3d rotation is standard for controlling transforms. Whatever else is from the pre-ages before axis-angle and quaternions. Angle and up is not used anywhere else, gltf, collada,, etc.,  included so for the wider range of users, angle and up are archaic and I don’t think ever will ever be encountered in the GL.
>
>
>
> 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.
>
>
>
> Well, for x3d, “taste” and  best practice is in  the x3d standard. Maybe angle and up are more readable for some  but misleadingly easy. If you think it is easier, show me code for some viewpoint animations. I’ve got one I will send.
>
>
>
> 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.
>
>
>
> Fine, not as good as front panel. If you are stuck on that form, then at least give a visible option or it is really not an x3d authoring aid. Of course the authoring idea is that you move a viewpoint to where you want it and read the value, then put it in the user code.
>
>
>
> 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.
>
>
>
> No Luck on this end. Please try clicking File, Reopen (4.0.3) on the menu yourself (i don’t see Reload anywhere). Your Alt-Tab suggestion doesn’t get it either, no change after editing the target file. Never reloads. Here  Alt Tab is captured by Windows and gives me the collection of available windows. OPEN and clicking a same file works as a Reload, or File and Open also can get current file.
>
> File, Reopen is dead here, and Alt Tab isn’t caught by view3dscene. .
>
>
>
> 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 ).
>
>
>
> Please see above. Latest on view3dscene site: 4.3.0 .
>
>
>
> 3. "Phong Shading on Everything" is actually more correct. E.g. it
>
> multiplies the diffuse color by diffuse texture only.
>
>
>
> Still, it looks lots different than on every other player. Unchecking Phong everything make it look almost like it looks in others. I can send some examples.
>
>
>
>   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).
>
>
>
> OK. Will show some examples. How is your implementation more flexible?
>
>
>
> 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".
>
>
>
> CGE extension? Is it proposed for the x3d standard?
>
>
>
> Regards,
> Michalis
>
>
>
> Thanks Again,
>
> Joe
>
>
>
>
>
>
>
>
>
> ś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