Relative positions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
TestDev
Posts: 11
Joined: Tue Jun 19, 2018 3:15 pm

Relative positions

Post by TestDev »

Hello All,

I am quite new to the engine and I am just trying to get my feet wet. So I have a few simple questions that I was wondering if you could help with:

1) Is it possible to set positions relative to other objects (Even if this is limited to parents)
2) Does IrrLicht provide methods to move / rotate an object relative to its own axis ( eg if an object was rotated 90, when it moved upwards relative to itself it would move to the right relative to the stage (absolutely)
3)Does IrrLicht provide other was of representing 3d space and coordinates, other than vector3D, eg quaternions or matrices.

Also as a bonus question (As I am a bit away from this but it has been bouncing around my head for a bit), does IrrLicht provide a way to dynamically alter the texture. So for more context say I have node1 with it's complex texture and I want to colourise it to make it redder dynamically. I have though of two ways (not that I am sure of the feasibility in this engine yet) but was wanting more suggestions:
- Apply a second texture on top which is fully red and adjust the alpha to set the redness
- Load the texture and then alter it in memory to create a temporary texture with all the RGB values changed to a be more R ( This would be much more work.)

Thanks for reading!
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Relative positions

Post by chronologicaldot »

By default, Scene Nodes are relative (in transformation, rotation, and scale) to their parent object. All you have to do is give them a parent, and when you set their translation/rotation/scale, it sets the relative transformation. There are no methods for setting one scene node at some relative value to another, unrelated one, so far as I know. i.e. No shortcut functions.

Matrices hold the actual information internally, but you can't access it from outside the class. You can, however, store matrix and quaternion information in a class inheriting ISceneNodeAnimator and use that to change the node.

It is possible to edit textures, but this gets tricky because it's based on the video driver you choose. I find Burnings to be easiest when aiming for full control over texture editing. I can't tell the context of your need, otherwise I could offer more advice.

Someone else want to chime in?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Relative positions

Post by CuteAlien »

It's often somewhat possible to change colors by multiplying textures with vertex-colors. Thought depending on the manipulations at some point it becomes easier to write shaders (in which things like adding a color-tint is trivial - but the hard part is to start having a shader first which does all the light-calculations).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
TestDev
Posts: 11
Joined: Tue Jun 19, 2018 3:15 pm

Re: Relative positions

Post by TestDev »

Thanks for both of your help!
Post Reply