About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Dynamic Terrain ?
Author Message
ronghester Offline
Bronze Supporter

Post: #1
Dynamic Terrain ?
Hi,

To be very precise i just wanted to ask if map visualization like the below unity3d plugin will be possible in esenthel ?
plugin link : https://www.assetstore.unity3d.com/en/#!/content/68889

Let me tell you how this plugin works.
It creates plane (just a plane geometry) and texture it with the map texture. Then it draws the geometries like boxes on certain locations. As the user moves the planes are redrawn.

I believe esenthel is capable of doing anything, but there is always a right way of doing it. So if we have to try something like this in esenthel what would be the best approach?

Dynamic Terrain ? Or Just Planes or sprites.

What i am looking at here is the best approach to do it.

Let me know
Thanks in advance.
08-22-2017 04:58 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Dynamic Terrain ?
Hi,

To draw graphics from dynamic data you can use VI.
Or to construct graphics only once, and render them multiple times, you can manually create Mesh'es.
For Terrain based heightmaps, you can use Heightmap class.

There are tutorials for these functions.
08-23-2017 01:32 AM
Find all posts by this user Quote this message in a reply
ronghester Offline
Bronze Supporter

Post: #3
RE: Dynamic Terrain ?
Thanks Esenthel!

I did my homework on this and I think blocks_map might be the best approach. I have tried the blocks sample in tutorials and I have few questions on block_map/blocks. I hope you don't mind answering..

1. How to position the blocks? (Is there a way to change the centerpoint of block_map or blocks). I am moving the camera forward and I want to re-draw the blocks based on camera position so that it stays in visible range.

2. How to set different mesh in blocks? I tried setting plane3d instead of BoxI in setMesh function but looks like it only takes BoxI ?

I know if i buy the source code, it would be lot easier for me to find out these things on my own, but I don't want to invest on that right now.

So any help would be appreciated.

Thanks
09-03-2017 07:27 AM
Find all posts by this user Quote this message in a reply
ronghester Offline
Bronze Supporter

Post: #4
RE: Dynamic Terrain ?
I suppose the x,y and z specified in the set method for blocks are local coordinates or position specified for rows and column. Please correct me if i am wrong?

Any Help here would be appreciated?
09-10-2017 08:50 AM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #5
RE: Dynamic Terrain ?
is there a particular reason why you want to use blocks ?
looking at what you want to accomplish, i wouldnt be using blocks
09-10-2017 06:32 PM
Find all posts by this user Quote this message in a reply
ronghester Offline
Bronze Supporter

Post: #6
RE: Dynamic Terrain ?
Actually blocks already use the tile coordinates which can easily be tied up to the map coordinates. If i use blocks it would take me lot less time than creating this whole system on my own.

I just want to know how to move blocks center so that i can position them as user moves the camera.
09-11-2017 03:10 PM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #7
RE: Dynamic Terrain ?
blocks_map.matrix(1, 1) will move the center of the blocks by 1. is that what youre looking for ?
(This post was last modified: 09-11-2017 07:14 PM by RedcrowProd.)
09-11-2017 07:13 PM
Find all posts by this user Quote this message in a reply
ronghester Offline
Bronze Supporter

Post: #8
RE: Dynamic Terrain ?
Sorry I was away for some time. I did some work with blocks and it does not going to work for me. So i have a very basic question now

1. How to draw a quad (with equal sides) and texture the camera facing side with image?

What i have decided to do is, draw quads and then texture it with mapimages. Sort of tiles system.

Please let me know

Thanks
12-15-2017 07:14 PM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #9
RE: Dynamic Terrain ?
Using VI you should be able to do this quite easely
There might be a tutorial on vertex index or worse case ill check what i have when i get home smile
12-15-2017 11:30 PM
Find all posts by this user Quote this message in a reply
ronghester Offline
Bronze Supporter

Post: #10
RE: Dynamic Terrain ?
In VI i can see following options to draw Rect & quad methods are
*rect
*quad

But how to texture the front of the quad with image?

Also Rect_L or Rect_C method will also work. Not able to find out how to texture the rect. Any help would be appreciated.

Thanks
12-16-2017 07:38 PM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #11
RE: Dynamic Terrain ?
you would look into the Vtx3DTexCol;

and using VI you can call stuff.

exemple of a class i was using before ( credit to pherael )

Memc<MobileDecal> MD;
class MobileDecal
{
ImagePtr image;
Vec pos;
flt size;

flt alpha = 1; // 0 to 1.
flt angle = 180;

MobileDecal & create(ImagePtr img, Vec pos, flt size=1)
{
T.pos = pos;
image = img;
T.size = size;
return T;
}

void moveTo(Vec pos, flt angle)
{
T.pos = pos;
T.angle = angle;
}

void moveTo(Vec pos)
{
T.pos = pos;
}

void setSize(flt size)
{
T.size = size;
}

void setAlpha(flt alpha)
{
T.alpha = alpha;
}

void draw()
{
SetMatrix();
Vtx3DTexCol v[4];
flt halfsize = size/2;

FREPA(v)
{
v[i].color = ColorAlpha(alpha);
}

Vec vt[4];
vt[0].set(-halfsize, size , 0);
vt[1].set(-halfsize, 0 , 0);
vt[2].set(halfsize, 0 , 0);
vt[3].set(halfsize, size , 0);

Matrix m(pos, Cam.matrix.orn());
REPAO(vt).mul(m);

v[0].pos.set(pos.x+vt[0].x, pos.y+vt[0].y, pos.z+vt[0].z); v[0].tex.set(0, 1);
v[1].pos.set(pos.x+vt[1].x, pos.y+vt[1].y, pos.z+vt[1].z); v[1].tex.set(0, 0);
v[2].pos.set(pos.x+vt[2].x, pos.y+vt[2].y, pos.z+vt[2].z); v[2].tex.set(1, 0);
v[3].pos.set(pos.x+vt[3].x, pos.y+vt[3].y, pos.z+vt[3].z); v[3].tex.set(1, 1);



/*v[0].pos.set(pos.x-Cos(angle)*size , pos.y, pos.z+Sin(angle)*size);
v[1].pos.set(pos.x-Sin(angle)*size , pos.y + size, pos.z-Cos(angle)*size);
v[2].pos.set(pos.x+Cos(angle)*size , pos.y + size, pos.z-Sin(angle)*size);
v[3].pos.set(pos.x+Sin(angle)*size , pos.y, pos.z+Cos(angle)*size); */

VI.image(image());
VI.face(v[0], v[1], v[2], v[3]);
VI.end ();
}
}
12-16-2017 08:05 PM
Find all posts by this user Quote this message in a reply
Post Reply