论坛

由用户创建的信息 cuteshall
04 November 2024 04:32 [ON MODERATION]
The Principled BSDF Shader in Blender's Cycles and EEVEE engines has simplified creating realistic, PBR-based materials, making it popular among users. Snow Rider
While Blend4Web’s support for advanced PBR has been limited, newer tools like Verge3D and Blender’s GLTF exporter are better options for real-time web content, as they support the Principled Shader and PBR materials more seamlessly. If you're looking to publish realistic 3D content online, these tools offer compatibility with Blender's EEVEE and PBR workflows.
25 September 2024 06:40 [ON MODERATION]
In 3D engines like Unity or Unreal, raycasting is used to detect what object is being clicked on. Typically, when you click in the scene, a ray is cast from the camera through the mouse's click position into the scene, and it returns all objects it hits.
Ensure the first object hit by the ray (the closest one) is selected. Other objects behind it should be ignored.
In Unity, use Physics.Raycast to perform a raycast and set the object that gets hit first as the selected object.
You can also use layer masking to ensure that only certain objects are eligible for selection. By assigning a unique layer to your selectable objects, you can cast rays that only interact with objects in that layer. Snow Rider
If you're using a 2D framework or dealing with UI objects, make sure you're checking hitboxes or bounding boxes for clicks. Often, the engine provides a function to return only the topmost object at a given point.
In Unity’s UI system, for example, you can use EventSystem.current.RaycastAll() to ensure the top UI element is selected.
If you're using custom rendering or logic, you can perform occlusion checking. Ensure that objects behind the top object are not selected. This can be done by checking object depth or sorting based on the distance from the camera.
If objects have transparent or invisible parts (like a tree with transparent leaves), ensure the click only registers for the opaque portions by adjusting the collider or the click detection to ignore transparency.
25 September 2024 06:38 [ON MODERATION]
Reply to post of user stephane
Hi there,

Can someone tell me what does not work in my code?

My scene:
I have an eye camera placed on a cube that is my character.

I would like the left side of the screen to control the translation as the right rotation.

Here is the link to test my application: Snow Rider

Here is the link of my code:

I think the problem is in the setup_rotation() line 347, but I do not see.

I imagine that for top and down rotation I have to do it on the camera while the right and the left rotation on the character.
But in any case, for the moment the character does not makes any rotation …

If anyone knows it would be great.
In the meantime I continue to search.

thanks a lot
Rotation Logic: Ensure that the rotation logic in the setup_rotation() function is correctly implemented. You might want to confirm that you're applying the rotation to the correct object (the camera versus the character). If the character is not rotating at all, check if the rotation values are being computed and applied correctly.

Input Handling: Make sure that your touch or tilt input handling is correctly mapping the left side of the screen for translation and the right side for rotation. If the touch events aren’t being recognized, the expected behavior won’t happen.

Camera and Character Control Separation: You mentioned wanting to control the top and down rotation of the camera while handling the right and left rotation on the character. Ensure that the logic correctly distinguishes between these inputs and applies them to the right object.

Debugging: Add debug statements in your setup_rotation() method to log the rotation values and confirm that they are being updated as expected. This can help isolate where the issue lies.

Code Review: Without seeing the exact implementation in setup_rotation(), it's hard to pinpoint the issue. However, commonly in 3D graphics programming, issues can arise from coordinate system mismatches or not updating the transformation matrix after applying rotations.