Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
Water renderer 3D Line 3D Image and more.

sakura
Registered User
Quote
2023-04-02 20:47:03

Hello, forum friends. My function library has been updated again.

The current version that is 1.2.

Fixed the problem that the Z-axis direction of GetEndPoint function is not consistent with CopperCube.

Fixed an exception caused if the VMD camera animation finished playing after freezing the window.

Optimized the optional parameters in the function library.

This update brings many interesting features, such as water rendering, drawing lines and images in 3D space, which I hope you will enjoy.

Here is the download link.
https://send.cm/d/NZar


sakura
Registered User
Quote
2023-04-02 20:49:52

Water rendering with real wave effect, you can adjust the water speed, wave distance and amplitude by parameters.
🔎︎

I may continue to improve the renderer later, so if you have ideas or suggestions, feel free to leave a comment.

In the future I will also try to create various rendering effects to extend the functionality of CopperCube.


sakura
Registered User
Quote
2023-04-02 20:50:48

Screen shaking effect, you can easily implement a simple earthquake simulation.
🔎︎



sakura
Registered User
Quote
2023-04-02 20:51:56

Image drawing with pointing effect that you can use to make tips in the game.

You can set the distance to adjust the display range so that the image is displayed only when the player is close to the object.

🔎︎



sakura
Registered User
Quote
2023-04-02 20:52:33

Lines can be drawn between two objects or between any 3D coordinate points, which allows for many interesting effects.
🔎︎



sakura
Registered User
Quote
2023-04-02 20:53:18

Draw images on objects, for example you can add icons to doors in the game that prompt the player to press E to open the door.
🔎︎



sakura
Registered User
Quote
2023-04-02 20:53:58

The line can be pointed at an object, for example to guide the player in a game, or used together with the GetEndPoint function to achieve the effect of a laser.
🔎︎



sakura
Registered User
Quote
2023-04-02 20:55:06

These are the new functions and documentation added this time.

Version 1.2
Draw3DLine(color,point1,point2,opacity)
Draw a line in 3D space connecting two 3D coordinates.
The point1 and point2 structure is {x:0,y:0,z:0}.
The opacity is an optional parameter.
When opacity is not set, transparency is based on color.

DrawLineTo3D(color,screenPoint,point,opacity)
Draw a line in 3D space to connect the coordinates on the screen to the 3D coordinates.
The screenPoint is an optional parameter.
The screenPoint structure is {x:0,y:0}.
If you set screenPoint to null, it defaults to the center of the screen.
The point structure is {x:0,y:0,z:0}.
The opacity is an optional parameter.
When opacity is not set, transparency is based on color.

GetDistance(point1,point2)
Calculate the distance between two points in 3D space.
The point1 and point2 structure is {x:0,y:0,z:0}.

DrawImage(name,x,y,width,height,isReverse,isOpaque)
Draw image on the screen.
The name parameter is the name of the image.
The x and y are the positions on the screen.
The width and height are optional parameters.
When the width and height are not set,
the default values are the original width and height of the image.
Modify the width and height parameters and you can scale the image.
The isReverse is an optional parameter.
When set to true, the image will be reversed.
The isOpaque is an optional parameter.
When set to true, the image will be drawn as opaque even if it is transparent.

Draw3DImage(name,point,currentPoint,maxDistance,size,isScale)
Draw an image in 3D space.
The name parameter is the name of the image.
The point structure is {x:0,y:0,z:0}.
Usually it's an object.
If maxDistance is not set, currentPoint is an optional parameter.
The currentPoint structure is {x:0,y:0,z:0}.
Usually it's a camera.
When the distance from point is greater than maxDistance, the image will disappear.
The size is an optional parameter.
Modify size to change the width and height of the image.
The size structure is {width:0,height:0}.
The isScale is an optional parameter.
When set to false, the image does not scale down as the distance increases.

DrawImageTo3D(color,name,screenPoint,point,currentPoint,maxDistance,size,enableLine)
Draw an image on the screen and point to the coordinates in 3D space.
The color is the color of the line.
The name parameter is the name of the image.
The screenPoint structure is {x:0,y:0}.
The point structure is {x:0,y:0,z:0}.
Usually it's an object.
If maxDistance is not set, currentPoint is an optional parameter.
The currentPoint structure is {x:0,y:0,z:0}.
Usually it's a camera.
When the distance from point is greater than maxDistance, the image will disappear.
The size is an optional parameter.
Modify size to change the width and height of the image.
The size structure is {width:0,height:0}.
The enableLine is an optional parameter.
When enableLine is set to false, no lines are drawn.

GetDegInRange(deg,range)
Converts out of range degrees to in range degrees.
For example GetDegInRange(400,360), you will get 40 degrees.
The deg is the number of degrees of the angle.
The range is the maximum number of degrees.

ShakeCamera(cameraNode,time,freq,amplitude)
Shake the camera. For example, simulating an earthquake.
The time parameter is the duration.
The freq parameter is the frequency, the number of shakes per second.
The amplitude parameter is the strength of the shake.

IsShakeCameraStop()
Returns the state of camera shake,
true means it is shaking, false means it is stopped.

StopShakeCamera()
Stop shaking the camera.


sakura
Registered User
Quote
2023-04-02 20:56:05

IsObjectInScreen(objectNode,cameraNode,objectSize,maxDistance)
Determines if the object is existed in the screen.
The objectSize is an optional parameter.
The objectSize structure is {width:0,height:0}.
If you need to strictly determine if the object is existing in the screen,
you need to modify objectSize so that the object is not determined to have disappeared
when it is at the edge of the screen.
The maxDistance is an optional parameter.
If maxDistance is set, the object is determined to disappear
when it is over the maximum distance.

IsObjectHit(objectNode,position,rotation,maxDistance)
Determine whether an object can be hit
at a certain position, at a certain rotation, and at a certain distance.
The position structure is {x:0,y:0,z:0}.
The rotation structure is {x:0,y:0,z:0}.
The position and rotation parameters usually mean the position and rotation of the camera.
The maxDistance is the maximum distance to determine.

WaterRenderer(planeNode,speed,waveDistance,amplitude,direction)
Water renderer to simulate the effect of undulating water surface.
The more grids on the plane, the more realistic the rendering will be.
For example, the number of grids = width * height.
For a width and height of 100 each, the recommended number of grids is 10000.
Currently to use this function, you need to set the texture on the plane.
The speed is an optional parameter.
The speed is the speed of water flow.
The waveDistance is an optional parameter.
The waveDistance is the distance between each wave crest.
The amplitude is an optional parameter.
The amplitude is the strength of the wave undulation.
The direction is an optional parameter.
The direction is the direction of motion of the wave texture.
Its parameter is a string type. It includes x,y,xy,-x,-y,-xy;


sakura
Registered User
Quote
2023-04-02 20:56:30

I look forward to seeing you all next time, and if you have any ideas or suggestions, please feel free to leave a comment.

Let's make CopperCube better together.


harun_cakann
Registered User
Quote
2023-04-03 00:18:20

wrote:
Water rendering with real wave effect, you can adjust the water speed, wave distance and amplitude by parameters.
🔎︎

I may continue to improve the renderer later, so if you have ideas or suggestions, feel free to leave a comment.

In the future I will also try to create various rendering effects to extend the functionality of CopperCube.




do you have ccb


just_in_case
Moderator
Quote
2023-04-03 00:47:44

Thanks for the water, I wanted to create this myself, I hhad a discussion with @pmax recently in a post regarding this. I will check out this when I get time, but I am still planning to create my own version of water shader or geometry displacement. As there is some API commands that breaks the internal water completely, so I need to create my own shader. Thanks for sharing????


j9907
Guest
Quote
2023-04-03 12:46:21

Wow, that water is beautiful. I look forward to that becoming public. Seriously!

Trying to think of how a swimming mechanic could be introduced. I'd image a proximity volume would be used which is under the water plane, and the gravity value would be lowered. Idk. I've never looked into it. Still fun to imagine.


andgameplay
Registered User
Quote
2023-04-03 15:33:00

Fantastic Sakura! Your work is amazing! thanks to share! Keep doing this excellent work!


sakura
Registered User
Quote
2023-04-03 16:34:04

wrote:
Thanks for the water, I wanted to create this myself, I hhad a discussion with @pmax recently in a post regarding this. I will check out this when I get time, but I am still planning to create my own version of water shader or geometry displacement. As there is some API commands that breaks the internal water completely, so I need to create my own shader. Thanks for sharing????


That is really great, looking forward to your water shader.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact