Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Sonntag, 6. März 2011, 17:36

string and vectormath plugins

I have released two more utility plugins, and bundled my swf-based plugins as the krpano_fovplugin suite. As with my previous plugins, they are free to use and their sources are available as GPL open source.

string
Provides the following functions designed to complement txtadd provided by krpano itself:
  • txtlength(destVar, text)
    Sets destVar to the length of 'text'
  • txtchunk(destVar, text, start, length)
    Sets destVar to the substring of 'text', starting from 'start' and 'length' characters long
  • txtfind(destVar, text, find)
    Sets destVar to the position of 'find' in 'text', or -1 if the text is not found
  • txtreplace(destVar, text, find, replace, flags)
    Sets destVar to a copy of 'text', replacing 'find' with 'replace'. The optional 'flags' argument can be used to set flags for the internal regular expression pattern (and defaults to ''gi' for a global, case-insensitive replace).
vectormath
Provides the following functions:
  • sin(destVar, angle)
    Sets destVar to the sine of 'angle'
  • cos(destVar, angle)
    Sets destVar to the cosine of 'angle'
  • tan(destVar, angle)
    Sets destVar to the tangens of 'angle'
  • asin(destVar, number)
    Sets destVar to the inverse sine of 'number'
  • acos(destVar, number)
    Sets destVar to the inverse cosine of 'number'
  • atan(destVar, number)
    Sets destVar to the inverse tangent of 'number'
  • atan2(destVar, opposite, adjacent)
    Sets destVar to the inverse tangent of 'opposite'/'adjacent'
  • anglebetween(destVar, ath1, atv1, ath2, atv2)
    Sets destVar to the angle between the two vectors defined by ('ath1', 'atv1') and ('ath2', 'atv2')
  • normal(destVarH, destVarV, ath1, atv1, ath2, atv2)
    Sets destVarH and destVarV to align with the normal of the two vectors defined by ('ath1', 'atv1') and ('ath2', 'atv2')
  • rotatevector(destVarH, destVarV, ath1, atv1, ath2, atv2)
    Sets destVarH and destVarV to align with the vector ('ath1', 'atv1') after it has been rotated by ('ath2', 'atv2')

All angles are specified and returned in degrees, and axis rotations are done in the same order as krpano does them.

The string.swf and vectormath.swf files are available as part of the krpano_fovplugins package on github. See the examples folders for usage examples.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »ahoeben« (15. März 2011, 16:54)


Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

2

Sonntag, 6. März 2011, 17:54

Aldo! Master!

great stuff!

I think it would be nice to make the examples like real world examples.. just to see for dummy's.. (pictures and simple code example)
espesialy the vectormath and string ones..

I would like a tickertape plugin.. that loops the text...
i tried to fake it a bit with the textmachine and tween but that's no serious option.

Some drinks for Aldo in the krpano bar and Cafe

Cheers!
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

3

Sonntag, 6. März 2011, 18:05

Thanks Aldo for your intelligent generosity *smile* ...
It is great to have guys like you *thumbup* .

SAlut.

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

4

Sonntag, 6. März 2011, 18:06

yep..

got it..

GREAT!!!

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

5

Sonntag, 6. März 2011, 18:15

only don't understand that string thing..

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

6

Sonntag, 6. März 2011, 18:20

could i use that for the tickertape thing?

tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

7

Sonntag, 6. März 2011, 18:23

Zitat

I think it would be nice to make the examples like real world examples..


The vectormath plugin is somewhat special purpose. If you don't understand how you would use them, you probably don't need them in the first place. But if you have ever thought "I wish I could put a hotspot exactly perpendicular to two other hotspots", then the vectormath plugin is what you need. You don't have to use this plugin, but if you need it, it is there ;-). I am not yet at liberty to share why I needed the vectormath plugin myself.

The string plugin contains krpano specific string manipulations which are missing from krpano itself. Sometimes, especially if you pull in data from different sources, you want to be able to process text a bit more. For example truncating a text to a maximum of 20 characters. The example includes the code to do just that.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »ahoeben« (6. März 2011, 18:39)


Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

8

Sonntag, 6. März 2011, 18:28

Oke thanx for the explanation!

i understand now better..
Well you can also have just fun and let people see pano's partial or totally upside down ;-)

i was thiking about that ship on the sea to give it a roll ;-)

i see what you mean with the string in the logkey..

could i use that string plugin to make sort of a tickertape thing?
also using stage width? and repeating text?

or is there a better way...

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

9

Sonntag, 6. März 2011, 18:40

I guess you could use the string plugin for a ticker tape... (though I am not a fan of ticker tapes)

The following code is incomplete and entirely untested. But in theory it could work.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<krpano onstart="delayedcall(0.1,startticker())">
<data name="tickertape">
  Your ticker text would go here. And typically it would be quite long, or why would you want a ticker in the first place?
</data>
<plugin name="tickertext" src="textfield.swf" (... positioning and styling goes here...) />
<plugin name="string" src="string.swf" />

<action name="startticker">
plugin[string].txtlength(tickertape_length, get(data[tickertape].content));
set(ticker_length,0);
set(ticker_offset,0);
delayedcall(0.25, tickertick);
</action>

<action name="tickertick">
plugin[string].txtchunk(chunk, get(data[tickertape].content), ticker_offset, ticker_length);
txtadd(plugin[tickertext].html, "[p]", chunk, "[/p]");

if(ticker_length LT 10,
  inc(ticker_length);
,
  if(ticker_offset LT tickertape_length,
    inc(ticker_offset);
    delayedcall(0.25, tickertick);
  )
);
</action>

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

10

Sonntag, 6. März 2011, 18:56

mmm..

i can't get it now..
i'll try later..

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

11

Montag, 7. März 2011, 02:00

Hi Tuur,

Here a working one (after little correction in Ahoeben's code *thumbup* ):

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<krpano onstart="delayedcall(2,startticker())">
<data name="tickertape">
  Your ticker text would go here. And typically it would be quite long, or why would you want a ticker in the first place?
</data>
	
<plugin name="tickertext" url="%SWFPATH%/plugins/textfield.swf" 
		origin="center" 
    	width="160" height="20" 
    	x="0" y="0" 
    	html="SAlut"
    	borderwidth="1"
    	bordercolor="0xFFFFFF"
    	backgroundcolor="0xFFFFFF"
		/>
<plugin name="string" url="%SWFPATH%/plugins/string.swf" />

<action name="startticker">
plugin[string].txtlength(tickertape_length, get(data[tickertape].content));
trace('tickertape_length = ',tickertape_length);
set(ticker_length,0);
set(ticker_offset,0);
delayedcall(0.25, tickertick);
</action>

<action name="tickertick">
plugin[string].txtchunk(chunk, get(data[tickertape].content), get(ticker_offset), get(ticker_length));
trace('chunk = ',chunk);
txtadd(plugin[tickertext].html, "[p]", get(chunk), "[/p]");
trace('chunk = ',chunk);
if(ticker_length LT 30,
  inc(ticker_length);
	delayedcall(0.15, tickertick);
,
  if(ticker_offset LT tickertape_length,
	inc(ticker_offset);
	delayedcall(0.15, tickertick);
	,	
	delayedcall(5, startticker);
  );
);
</action>
</krpano>


SAlut.

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

12

Montag, 7. März 2011, 02:09

Great!

Thanx Michel and Ahoeben!! *thumbsup* *thumbsup*

Cheers

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

13

Montag, 7. März 2011, 11:25

Ah, yes... you need to use get() with the variables. Thanks michel

14

Montag, 7. März 2011, 15:38

By the way, I am open to suggestions if you need more text manipulation or (vector)math methods. I am also open to patches to the sources if someone feels inclined to make improvements. And finally I am open to donations ;-)

15

Samstag, 26. März 2011, 14:12

I just become aware of this plugins collection and looks like a very good one.

Gongrats!



Dorin
www.livepanoramas.com

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

16

Mittwoch, 30. März 2011, 13:28

Hi,
Is there an , XML , way to make à textmachine ?
That works on iPhone / pad..
So that THE NeXT syllable is coming like 0.15 seconds after THE previous one.
And Also get that with variables in textfield on mobile devices??

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

17

Mittwoch, 30. März 2011, 14:18

How is what you call a "textmachine" different from a "ticker" as Michel (and I) posted above?

The plugin is only available as aswf now (so it won't work on ios devices). krpano 1.14 will bring the capability to have actual javascript plugins for the ios/html5 viewer, so then it should be possible to write versions of some of my scripting plugins that work on ios as well.

As for the "other" type of mobile devices... Android-powered devices that have Flash should already be able to use the current batch of plugins.

Tuur

Erleuchteter

Beiträge: 2 775

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

18

Mittwoch, 30. März 2011, 14:23

He Aldo,

thanx for the answere.. i now .. there is a flash version from what i mean already... maybe this is the wrong threath to ask in..

Grtz

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

19

Montag, 4. April 2011, 22:10

The string plugin is now also available in a js version for krpanoJS:
http://fieldofview.github.com/krpano_fov…ing/plugin.html
(soon also on the official plugins page)

The vectormath plugin will follow suit (eventually).

20

Samstag, 9. April 2011, 05:11

Hi Ahoeben,

It seems that there is a mistake on the vectormath definition of the rotatevector() function:
  • rotatevector(destVarH, destVarV, ath1, atv1, ath2, atv2)
    Sets destVarH and destVarV to align with the vector ('ath1', 'atv1') after it has been rotated by ('ath2', 'atv2')
After reading your example code, in my understanding it should be something like:

Zitat

  • rotatevector(destVarH, destVarV, destVarR, ath1, atv1, rotate1, ath2, atv2, rotate2)
    Sets destVarH, destVarV and destVarR to align with the vector ('ath1', 'atv1', 'rotate1') after it has been rotated by ('ath2', 'atv2', 'rotate2')
Or...

SAlut.

Ähnliche Themen