How can i modify the points on face area with ARFaceAnchor? - geometry

i can got mesh points coordinates with the code like this:
faceAnchor.geometry.vertices ,
now i want to modify them , like make eyes bigger。
how can i do it ?
any advice would be appreciated。

Related

How to display blocks on PlantUML diagram vertically?

I've got the following sample code (in real I've got hundred/thousands of lines):
#startuml
[326976]<->[7bfe53]
[868224]<->[49e442]
[777408]<->[0de431]
[777408]<->[d8d3ed]
[454080]<->[99b073]
[750848]<->[05624c]
[319104]<->[264b51]
[319104]<->[ad0add]
[035840]<->[76d4fe]
[561280]<->[e7fd29]
[576640]<->[388451]
[674816]<->[bafca1]
[674816]<->[ec9992]
[505344]<->[1069ba]
[173120]<->[4ded8e]
[741888]<->[018d22]
[166464]<->[695028]
[122176]<->[5ed43a]
[122176]<->[72fcb1]
[950848]<->[93c4a2]
#enduml
However the diagram looks like:
With more number of blocks, the image (PNG) gets cut off with the following warnings:
Width too large 11516268
Creating image 4096x129
I'd like to display diagram vertically ideally with minimal code changes, is it possible?
My goal is to see shared connections on the graph when ID on the left shares multiple IDs on the right (and other way round).
I think you are looking for: left to right direction.
#startuml
left to right direction
[326976]<->[7bfe53]
[868224]<->[49e442]
[777408]<->[0de431]
[777408]<->[d8d3ed]
[454080]<->[99b073]
[750848]<->[05624c]
[319104]<->[264b51]
[319104]<->[ad0add]
[035840]<->[76d4fe]
[561280]<->[e7fd29]
[576640]<->[388451]
[674816]<->[bafca1]
[674816]<->[ec9992]
[505344]<->[1069ba]
[173120]<->[4ded8e]
[741888]<->[018d22]
[166464]<->[695028]
[122176]<->[5ed43a]
[122176]<->[72fcb1]
[950848]<->[93c4a2]
#enduml
output with left-to-right-direction
Additionally you might want to add double dashes.
#startuml
left to right direction
[326976]<-->[7bfe53]
[868224]<-->[49e442]
[777408]<-->[0de431]
[777408]<-->[d8d3ed]
[454080]<-->[99b073]
[750848]<-->[05624c]
[319104]<-->[264b51]
[319104]<-->[ad0add]
[035840]<-->[76d4fe]
[561280]<-->[e7fd29]
[576640]<-->[388451]
[674816]<-->[bafca1]
[674816]<-->[ec9992]
[505344]<-->[1069ba]
[173120]<-->[4ded8e]
[741888]<-->[018d22]
[166464]<-->[695028]
[122176]<-->[5ed43a]
[122176]<-->[72fcb1]
[950848]<-->[93c4a2]
#enduml
output with double dashes

How can I draw a line in Open Inventor 3D Graphics API?

I'm new to Open Inventor 3D Graphics API and I just want to draw a line between given to 3-D coordinates. Let's say the first point is 0,0,0 and the second is 1,1,1. The documentation and examples of this API are really awful and can't get it out right. I'm using Visual Studio.
If you just need to set the base color (what Open Inventor & OpenGL call diffuse color), which is usually the case for line geometry, then you can set it directly in the SoVertexProperty node.
For example, to make the line in the previous example 'red', add this line:
vprop->orderedRGBA = 0xff0000ff; // By default applies to all vertices
or, more conveniently:
vprop->orderedRGBA = SbColor(1,0,0).getPackedValue();
If you need more control over the appearance of the geometry, add an SoMaterial node to the scene graph before the geometry node.
Assuming you're just asking about creating the line shape - just store the coordinates in an SoVertexProperty node, set that node in an SoLineSet node, then add the line set to your scene graph. Open Inventor will assume that you want to use all the coordinates given, so that's all you need to do.
For just two coordinates it may be easiest to use the set1Value method, but you can also set the coordinates from an array. You didn't say which language you're using, so I'll show the code in C++ (C# and Java would be essentially the same except for language syntax differences):
SoVertexProperty* vprop = new SoVertexProperty();
vprop->vertex.set1Value( 0, 0,0,0 ); // Set first vertex to be 0,0,0
vprop->vertex.set1Value( 1, 1,1,1 ); // Set second vertex to be 1,1,1
SoLineSet* line = new SoLineSet();
line->vertexProperty = vprop;
sceneGraph->addChild( line );
Line thickness is specified by creating an SoDrawStyle property node and adding it to the scene graph before/above the geometry node. Like this:
SoDrawStyle* style = new SoDrawStyle();
style->lineWidth = 3; // "pixels" but see OpenGL docs
parent->addChild( style );

How to display '.cgal' File generated by CGAL:mcfskel

I'm new to CGAL and in the fields of computer graphics. I'm currently interested in doing CGAL:Mean Curvature Skeletonization. I tested the simple example program and it works. As a result, it generated a 'skel.cgal' files, which i think is the points for the generated 1D skeletal.
The problem is i don't know how to display it because normally it will be '.off' file format. I think about converting it to '.off' but don't know where to start. Hope you guys can help me out.
The output is a set a polylines. The format is:
n1 x1 y1 z1 ... xn1 yn1 zn1
...
ni x1 y1 z1 ... xni yni zni
The first number is the number of points for a polyline, followed by the 3D points.
If you want to have a look at it you can try the CGAL Polyhedron 3D demo.
You can compile it yourself from sources or use the precompiled windows version with its required dlls.

How to connect specific attributes over polar coordinates in R?

I have highlighted specific activities (feeding,resting and sleeping) from the dataset in my plot. Now I want to connect these highlighted points in sequence over my polar coordinates.
Here's my dataset:
Activity Latitude Longitude
Feeding 21.09542 71.06014
Resting 21.09564 71.06064
Sleeping 21.09619 71.06128
Walking 21.09636 71.06242
Walking 21.09667 71.06564
Resting 21.09483 71.06619
Can you help me out in this?
# Example dataframe
set.seed(1)
mydf=data.frame(Activity=sample(c("Walking","Feeding","Resting","Sleeping"),20,T),Latitude=rnorm(20,21,0.5),Longitude=rnorm(20,71,0.5))
mydf$Order=1:nrow(mydf)
If you want to connect the points in order regardless of the activity, do the following (for clarity, I added the variable mydf$Order to label the points).
# Plot
library(ggplot2)
ggplot(data=mydf)+
geom_point(aes(x=Latitude,y=Longitude,colour=Activity))+
geom_path(aes(x=Latitude,y=Longitude))+
geom_text(aes(x=Latitude,y=Longitude,label=Order))+
coord_polar(theta="y")
If you want to connect points according to activities, consider CMichael's answer.
Ok I am starting from scratch: My original answerwas much too bulky and inflexible.
Just add the following to get Paths for each Activity without filtering.
+ geom_path(aes(colour=ACTIVITY,x=Latitude,y=Longitude))
If you want to plot only selected Activities:
+ geom_path(data=Data[Data$ACTIVITY %in% c("Sleeping","Resting"),],aes(colour=ACTIVITY,x=Latitude,y=Longitude))
The selected Activities are to be listed in the c(...) vector with each name quoted.
UPDATE: OP clarified that he wants to connect any stationary point, this achieved by running the following:
+ geom_path(data=Data[Data$ACTIVITY!="Walking",],colour="red",aes(x=Latitude,y=Longitude))
Note that the colour=ACTIVITY is removed from the aesthetics and we consider all stationary points (!="Walking") to draw the path.
Code combining the two answers:
set.seed(1)
mydf=data.frame(Activity=sample(c("Walking","Walking","Walking","Walking","Walking","Resting","Feeding","Sleeping"),20,T),Latitude=rnorm(20,21,0.5),Longitude=rnorm(20,71,0.5))
mydf$Order=1:nrow(mydf)
# Plot
library(ggplot2)
ggplot(data=mydf)+
geom_point(aes(x=Latitude,y=Longitude,colour=Activity),size=5)+
geom_path(aes(x=Latitude,y=Longitude),size=1.2)+
geom_text(aes(x=Latitude,y=Longitude,label=Order))+
geom_path(data=mydf[mydf$Activity!="Walking",],colour="red",aes(x=Latitude,y=Longitude)) +
coord_polar(theta="y")

Merge Raphael Rect shapes

Trying to get these 2 raphael elements to both change color when hovered over one or the other. Here is the code I have. Any help would be appreciated.
var loge_1 = rsr.set();
loge_1a = rsr.rect(235.457, 287.645, 32.523, 45.486),
loge_1b = rsr.rect(235.139, 277.626, 32.933, 6.701);
loge_1.push(loge_1a,loge_1b);
loge_1.attr(logeFill);
I assume you got the code from ReadySetRaphael .... no doubt they have a very good algorithm for Raphael conversion ... try some large SVG files sometime and they will give you a good result .... anyways try this ...
loge_1.mouseover(function(){
loge_1.attr({'fill':'your Desired Color'});
}
loge_1.mouseout(function(){
loge_1.attr({'fill':'original color'});
}
this should change the color of both your rects .... Hope it helps.
Well after searching I didn't find much on the subject. So I have read up on svg elements and changed my "rect" to "path". Here is the W3C svg documentation
And here is the jsfiddle with "path"
To find my rectangles paths I just opened the svg file in Adobe AI. Then made sure my documents units was set to pixels. From there I opened my info window and just copied the my anchor points of my rectangles x & y coordinates into my "path" and presto I have 2 shapes acting as one.

Resources