Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#51 22-Jan-2014 12:12:16

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

you could for the mesh, but the names will not have all the same size, so you will need different plane sizes.

but for the material this is not possible, since one material instance is based on the material resource.
if you change the material texture it will be changed for all clients not only the one you want.
and if you draw the name on the texture get from the material resource, this will be the same.

so you need a different material and a different texture for each client name.
and for the mesh this way should be cleaner too.

Offline

#52 22-Jan-2014 14:08:03

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

Aaaah,  I begin to see arkeon.

Last edited by hebdemnobad (22-Jan-2014 16:22:02)

Offline

#53 22-Jan-2014 14:39:38

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

How do you set the scale of the plane? Or does the plane change in size automatically to display the texture?

Offline

#54 22-Jan-2014 18:18:08

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

no you have to set the plane size.
[width Height]

SO3PlaneCreate : create a plane as a SO3_OBJECT.

Prototype: fun [SO3_SCENE S S [F F] [I I] [F F]] SO3_OBJECT

Parameters:
SO3_SCENE    : current scene
S    : group name
S    : plane name
[F F] : width and height
[I I] : plane segmentation X and Y (1 default)
[F F] : UV tile (U and V, 1.0 default)
Returns:
SO3_OBJECT : Plane created if success, NIL otherwise

Offline

#55 23-Jan-2014 01:06:07

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

no you have to set the plane size.
[width Height]

SO3PlaneCreate : create a plane as a SO3_OBJECT.

Prototype: fun [SO3_SCENE S S [F F] [I I] [F F]] SO3_OBJECT

Parameters:
SO3_SCENE    : current scene
S    : group name
S    : plane name
[F F] : width and height
[I I] : plane segmentation X and Y (1 default)
[F F] : UV tile (U and V, 1.0 default)
Returns:
SO3_OBJECT : Plane created if success, NIL otherwise

How would you have os3d rescale the plane for longer strings to be the same size?

Offline

#56 23-Jan-2014 09:08:11

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

let G2DgetStringSize font text -> [width height] in

return the size of the string in pixel, you can use it to multiply a pixel / 3D unit ratio of your choice for example

Offline

#57 23-Jan-2014 13:51:48

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

Thx arkeon..... how do I determine the plane's height and width in pixels in order to multiply a pixel / 3D unit ratio?

Offline

#58 23-Jan-2014 14:26:45

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

for example :

let 10 -> margin in
let 0.01 -> ratio in //1px for 1 centimeter
let G2DgetStringSize font text -> [tw th] in
let tw + (margin * 2) -> tw in
let th + (margin * 2) -> th in
let [((itof tw) *. ratio) ((itof th) *. ratio)] -> planesize in

Offline

#59 23-Jan-2014 14:42:28

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

for example :

let 10 -> margin in
let 0.01 -> ratio in //1px for 1 centimeter
let G2DgetStringSize font text -> [tw th] in
let tw + (margin * 2) -> tw in
let th + (margin * 2) -> th in
let [((itof tw) *. ratio) ((itof th) *. ratio)] -> planesize in

Thx arkeon, but doesn't the ratio change depending on distance from camera shell to the plane.

Last edited by hebdemnobad (23-Jan-2014 14:42:49)

Offline

#60 23-Jan-2014 15:06:17

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

haaaa sure.
but if you want that then the name should be simply display on a 2D bitmap ^^ on the screen.
not on a 3D object.

there is a function to get a 3D object position on the 2D screen in pixel.

let SO3ViewportGetPixelPositionFromWorldPos viewportstr.V3D_viewport (SO3ObjectGetGlobalPosition obj) -> spos in

Offline

#61 23-Jan-2014 15:30:47

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

haaaa sure.
but if you want that then the name should be simply display on a 2D bitmap ^^ on the screen.
not on a 3D object.

there is a function to get a 3D object position on the 2D screen in pixel.

let SO3ViewportGetPixelPositionFromWorldPos viewportstr.V3D_viewport (SO3ObjectGetGlobalPosition obj) -> spos in

so instead of painting a plane, I would paint a 2d bitmap onto the screen.... and SO3ViewportGetPixelPositionFromWorldPos would give me the x and y coodrindates of the remote_bot shell depending on its xyz location.....maybe this is a better approach and more efficient from in terms of cpu/gpu usage....

before I get into this method, what happens when the bitmaps overlap each other? will two names, for example 'iri' and 'arkeon', overlap together and appear as one is combined with the other, or will only one of them display?

Last edited by hebdemnobad (23-Jan-2014 15:31:32)

Offline

#62 23-Jan-2014 15:33:06

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

I will stay on http://www.ifam.net/openspace/remote_bo … index.html if you want to chat about this

Offline

#63 23-Jan-2014 15:33:27

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

the widgets have priority order parameter.
the bitmap would just overlap the other.

Offline

#64 23-Jan-2014 15:47:25

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

the widgets have priority order parameter.
the bitmap would just overlap the other.

ok, I'll look at the api and plugit(s) to see how I create and paint widgets. this is the way I will go.

Offline

#65 23-Jan-2014 15:48:06

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

ok have look the picture plugIT for example

Offline

#66 23-Jan-2014 15:49:58

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

ok have look the picture plugIT for example


I will do that thx.

Offline

#67 25-Apr-2014 15:04:44

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon i can't find documentation of SO3ViewportGetPixelPositionFromWorldPos on redmine or via a google search....where would that be?

Offline

#68 25-Apr-2014 15:15:37

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

Ho it must be that I didn't update the online doc
will make this now

Offline

#69 25-Apr-2014 15:38:22

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

Ho it must be that I didn't update the online doc
will make this now

thx

does the function return?

[I I]

Last edited by hebdemnobad (25-Apr-2014 15:38:42)

Offline

#70 25-Apr-2014 16:42:16

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: painting text onto transparent bitmap and setting material on entity

yes

I've updated the online documentation here : http://redmine.scolring.org/projects/so … 73db78108d

Offline

#71 25-Apr-2014 17:07:10

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: painting text onto transparent bitmap and setting material on entity

arkeon wrote:

yes

I've updated the online documentation here : http://redmine.scolring.org/projects/so … 73db78108d

Thx

Offline

Board footer

Powered by FluxBB