# Thread: using the <p> and <v>

1. ## using the <p> and <v>

hello if got a question regarding the

and <v> elements
How does the offset work, where are the indices ?

example

Code :
```<mesh>
<source id="position"/>
<source id="texcoord0"/>
<source id="texcoord1"/>
<vertices id="verts">
<input semantic="POSITION" source="#position"/>
</vertices>
<lines count="2">
<input semantic="VERTEX" source="#verts" offset="0"/>
<input semantic="TEXCOORD" source="#texcoord0" offset="1"/>
<input semantic="TEXCOORD" source="#texcoord1" offset="1"/>

10 10 11 11 21 21 22 22</p>
</lines>
</mesh>```

do i , for the first input, use (10,10) as start point and (11,11) as ending ? where does offset one start for input 2 and 3?

thank you.

2. ## Re: using the <p> and <v>

Originally Posted by lumpin
do i , for the first input, use (10,10) as start point and (11,11) as ending ? where does offset one start for input 2 and 3?
Yes. From your example, the samples are: line1[p(10,10), p(11,11)], line2[p(21,21), p(22,22)].

3. ## Re: using the <p> and <v>

thanks.
but what about the offset? do i for offset = 1 start with [11,11] ?

4. ## Re: using the <p> and <v>

Given two inputs:

input A, offset=0
input B, offset=1

... then count=3 samplings go like this:

Code :
```
0 1 2 3 4 5```

... producing p1[0,1], p2[2,3], p3[4,5].

Add a third input with a shared offset:

input A, offset=0
input B, offset=1
input C, offset=1

... produces p1[0,1,1], p2[2,3,3], p3[4,5,5].

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•