[ Prev | Index | Next ]
Japanese English

Moving Coordinate Systems

This section covers how to move coordinate systems.

The movement discussed here is based on the axes of the parent coordinate system. Movement relative to the coordinate system's own axes will be covered in the next section, "Walking Coordinate Systems".

Moving a Coordinate System

To move a coordinate system, use the moveCoordinate(...) function.

- Function Format -

int moveCoordinate (
  int coordinateID,
  float dx, float dy, float dz
)

Arguments:

  • coordinateID: Specifies the ID of the coordinate system to move.
  • dx, dy, dz: Specify the distances to move in the X, Y, and Z directions, respectively.

Example Program

Let's try creating a local coordinate system, placing it on top of the world coordinate system, and then moving it. To make the difference clearer, we'll place a small axis model on the local coordinate system, and a large one on the world coordinate system.

To help illustrate the difference between this and "walking" (covered in the next section), we'll first rotate the local coordinate system slightly around the Z-axis before moving it.

Try running the following code:


import graphics3d.Graphics3DFramework;
import Graphics3D;

// Function called at the start of the program
void onStart ( int rendererID ) {

	// (Optional) Set window size and background color
	setWindowSize( 800, 600 );
	setBackgroundColor( 0, 0, 0, 255 );


	// Create a local coordinate system
	int coord = newCoordinate( );

	// Mount the local coordinate system onto the world coordinate system
	mountCoordinate( coord, rendererID );

	// Rotate the local coordinate system slightly around the Z-axis
	rotCoordinateZ( coord, 0.3 );

	// Move the local coordinate system
	moveCoordinate( coord, 1.0, 0.0, 0.0 );

	// Place a small axis model on the local coordinate system
	int axis1 = newAxisModel( 1.5, 1.5, 1.5 );
	mountModel( axis1, rendererID, coord );

	// Place a large axis model on the world coordinate system
	int axis2 = newAxisModel( 3.0, 3.0, 3.0 );
	mountModel( axis2, rendererID );
}
Sample.vcssl

When you run this program, two axis models appear on a black screen. The larger one is placed on the world coordinate system, and the smaller one is placed on the local coordinate system.

The local coordinate system is displayed at a position offset by (1.0, 0.0, 0.0) -- as seen from the parent coordinate system's axes.

Execution Result
Execution Result
The small one appears slightly shifted in the direction of the X-axis of the larger one.


Author of This Article

Fumihiro Matsui
[ Founder of RINEARN, Doctor of Science (Physics), Applied Info Tech Engineer ]
Develops VCSSL, RINEARN Graph 3D and more. Also writes guides and articles.

Translation Cooperator

ChatGPT AIs
[ GPT-3.5, 4, 5, 5.1 ]
We greatly appreciate the cooperation of ChatGPT AIs in translating this article.


Sponsored Link



Japanese English
Index
[ Prev | Index | Next ]
News From RINEARN
* VCSSL is developed by RINEARN.

Exevalator v2.4 Released — MCP Support Added, Now Usable as an AI Calculation Tool
2025-11-15 - We've released Exevalator v2.4, our expression-evaluation library. Starting with this version, it supports MCP, making it usable as a calculation tool for AI assistants.

Exevalator v2.3 Released — Now Usable from Python
2025-11-04 - We've released Exevalator v2.3. Starting with this version, you can now use it from Python! With growing demand around AI tool development in mind, we share the details here.

Exevalator Updated — Easy Japanese Localization for Error Messages
2025-10-31 - Exevalator 2.2.2 is out. You can now localize error messages to Japanese with a simple copy-and-paste, and we've included several bug fixes and minor parser adjustments.

Inside RINPn Online: Architecture Overview
2025-10-22 - An inside look at the architecture of the recently launched online version of the RINPn scientific calculator. It's open source, so you can freely modify and reuse it to build your own web calculator (maybe!).

Meet RINPn Online: Use the Scientific Calculator Anywhere, Instantly
2025-10-21 - RINPn, the free scientific calculator, now has an online version you can use instantly in your browser — on both PC and smartphones. Read the announcement for details.

The VCSSL Support AI is Here! — Requires a ChatGPT Plus Account for Practical Performance
2025-08-19 - A new AI assistant for the VCSSL programming language is here to answer your questions and help with coding. This article explains how to use it and showcases plenty of real Q&A and generated code examples.

English Documentation for Our Software and VCSSL Is Now Nearly Complete
2025-06-30 - We're happy to announce that the large-scale expansion of our English documentation with the support of AI — a project that began two years ago — has now reached its initial target milestone.

VCSSL 3.4.52 Released: Enhanced Integration with External Programs and More
2025-05-25 - This update introduces enhancements to the external program integration features (e.g., for running C-language executables). Several other improvements and fixes are also included. Details inside.