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.

#1 Re: Openspace3D » Move mesh object by mouse at runtime » 9-Sep-2019 10:18:43

Hello arkeon, yes I saw those plugits, but still was unable to move object as desired. May be I need a simple working example project, I think it will be of great use to all other users, as this is a key functionality of interaction with objects in 3D world..

#2 Re: Openspace3D » Move mesh object by mouse at runtime » 6-Sep-2019 23:30:11

So it is not an easy task to provide some example where I can move cube mesh at runtime and drag it on the screen? Sorry for asking for code)
For example if I want to create an VR app where one can place furniture (chairs, lamps, etc) where he likes to by dragging them with mouse. How can I handle this functionality? You example was interesting and helpful to some extent but still I do not know how to do it.

#3 Re: Openspace3D » Addsourcecode » 6-Sep-2019 23:23:48

Thank you! I have to explore it more.

#4 Re: Openspace3D » Move mesh object by mouse at runtime » 6-Sep-2019 12:24:52

Thank you very much! But my right mouse click does not move the cube.. Here's my log:

> Action : Scene.switch position.Input with param : NIL and reply param : NIL
> Event : Scene.mouse inst.MouseMove with param : NIL
> Action : Scene.switch position.Input with param : NIL and reply param : NIL
> Event : Scene.mouse inst.MouseMove with param : NIL
> Action : Scene.switch position.Input with param : NIL and reply param : NIL
> Event : Scene.mouse inst.MouseMove with param : NIL
> Action : Scene.switch position.Input with param : NIL and reply param : NIL

#5 Re: Openspace3D » Addsourcecode » 6-Sep-2019 12:18:24

Also I've found that main function should be placed at the very end of plugit editor. Otherwise it does not trigger function.

#6 Re: Openspace3D » Addsourcecode » 6-Sep-2019 12:13:14

So it seems not every Scol code can be run in this plugit. Your code:

fun printHello (string)=
                  //addLogMessage show messages in OS3D logs window
	addLogMessage strcat "Hello " string
	;;
	
fun testMainfunction ()=
	printHello "Scol Community !";
	0;;

My (wrong) code copy-pasted from manual:

fun printHello (string)=
	_fooS strcat "Hello " string
	;;
	
fun test ()=
	_showconsole;
	printHello "Scol Community !";
	0;;

#7 Re: Openspace3D » Addsourcecode » 6-Sep-2019 12:10:03

You are righ, my fault( I hit play and "> Hello Scol Community !" appeared. Thank you.

#8 Re: Openspace3D » Addsourcecode » 6-Sep-2019 12:03:55

arkeon wrote:

addsoursecode is not intended to make plugITs, just to use some scol code in your project or learn.

you can also make some code in links parameters with
if you want to make your own plugit start here : https://redmine.scolring.org/projects/s … ate_plugIT
and here https://redmine.scolring.org/projects/o … dules.html

also open existing simple plugits code to learn

I see, thank you..

#9 Re: Openspace3D » Addsourcecode » 6-Sep-2019 12:02:10

Already did it. Here's all that is in my log:

> Init default scene.
> Init default scene.
> Loading OpenSpace3D scene file : examples/addsourcecode.xos
> Number of plugIT instances in project: 2
> Number of links in project: 1
> examples/addsourcecode.xos loaded.

screen

No hello..

#10 Re: Openspace3D » Addsourcecode » 6-Sep-2019 11:50:00

Thank you arkeon, but when I load your code nothing happens. How can I practically use this addsource plugit? I thought it would let me develop my own plugits from scratch and editable it OS3D editor.
Could you give me some simple example with a button triggering a messagebox from addsoursecode plugit?

#11 Re: Openspace3D » Addsourcecode » 6-Sep-2019 11:43:58

Plugit log window gives this when I click button to run code:

> Event : Scene.Button inst.LeftClick with param : NIL
> Action : Scene.addsourcecode inst.Run with param : NIL and reply param : NIL

And pop up this window with some errors:

https://www.screencast.com/t/0eBFgpa8k10

If I close it editor crashes.

#12 Re: Openspace3D » Addsourcecode » 6-Sep-2019 11:18:42

Something like this (played a lot changing format - no result):


fun printHello (string)=
	_fooS strcat "Hello " string
	;;
	
fun test ()=
	_showconsole;
	printHello "Scol Community !";
	0;;

And setting "test" as name of main function.
And a logic / links like this:

logic
logic screenshot

#13 Openspace3D » Move mesh object by mouse at runtime » 6-Sep-2019 11:11:55

Coder108
Replies: 7

Can someone advise on how to do it? Tried almost every combination with different plugits but still no luck. I want the object follow the mouse when it's clicked and dragged. Could only achieve some jumps to where mouse is clicked. Thank you!

#14 Openspace3D » Addsourcecode » 6-Sep-2019 11:06:35

Coder108
Replies: 16

Hello! Could someone please provide some examples of how to use addsourcecode plugit?
In a form of OpenSpace3D project file.
I try to make it print Hello World from Scol manual when attached to a button click but nothing happens..(

Board footer

Powered by FluxBB