refactor rough pass

This commit is contained in:
spatialfree 2021-12-08 18:57:16 -05:00
parent 5926c0aba8
commit 1e4e810a06
26 changed files with 65 additions and 101 deletions

View file

@ -1,54 +1,41 @@
<img src='dofdev-logo.png' align="right" width="25%"> <img src='zrc/dofdev-logo.png' align="right" width="40%">
## oriels <code>
# oriels
*a dof driven space* *a dof driven space*
<img src='markberg.png' width="100%"> <img src='zrc/markberg.png' width="100%">
<br/> <br/>
## direction
- rethink paper paradigm based software for spatial computing
- networked by default through a federated server model
- smart contract for handling security and value
## increment
- ~~merge networking prototypes~~
- ~~fixed latency, now for multiple clients~~
- ~~architect interfaces for navigation~~
- implement all dofs from site
## override
**8 days left for the sterokit comp!**
### MVP
switch between cursors with a button (quick press(b) on both hands to switch/cycle through the two handed ones) long press(b) on one hand to swap mainhand
movement:
- ~~fullstick~~
- ~~teleport and drag~~
- ~~bezier rails~~
interact:
~~blocks you can manipulate with spatial cursors~~ (trackballer)
~~color them with the color cube (player colors)~~
- trackballer
- network the new stuff
software:
oriel + orbital view (control a shooty guy with fullstick and spatial cursor)
### POLISH
- fix (server sending back your data)
- *just show them red when hit*
- bezier in color cube
- calibrate cubic flow + sensitivity
- press and twist to adjust sensitivity (long press(b) and trigger for value *keep cursor active) (min 1:1)
### ACCESSIBILITY
show how the dofs work (debug visuals *CMY)
# pos
net.read()
c[] = reach-cursor * trackballer || cubic-flow
blocks.step(c[0].pose, c[3].pose)
cubics.step(c[0].pos, c[1].pos, c[2].pos, c[3].pos)
net.write()
oriel.raymarch()
<br><br> <br><br>
# dir
= (dof - paperParadigm).normalized
server.federate()
accounts = web3()
<br><br>
## ++
oriels.dofs == site.dofs
dofs.debug(CMY)
init(oriel-game)
exec(vlai)
<br><br>
## --
refactor(hackathon.result())
<br><br>
<br><br><br><br><br><br>
mapped out by: mapped out by:
@spatialfree * @opendegree <a href='https://ethanmerchant.com'>@spatialfree</a> * <a href='https://twitter.com/opendegree'>@opendegree</a>
</code>

View file

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View file

@ -269,8 +269,8 @@ psOut ps(psIn input) {
// } // }
if(sdBox(pos - _center, _dimensions / 2) <= 0.005) { if(sdBox(pos - _center, _dimensions / 2) <= 0.005) {
//float4 clipPos = mul(float4(pos, 1), sk_viewproj[input.view_id]); float4 clipPos = mul(float4(pos, 1), sk_viewproj[input.view_id]);
o.pos = mul(float4(o.world, 1), sk_viewproj[o.view_id]); // o.pos = mul(float4(o.world, 1), sk_viewproj[o.view_id]);
result.depth = clipPos.z; result.depth = clipPos.z;
// float4 viewWorldPos = mul(float4(pos, 1), sk_view[input.view_id]); // float4 viewWorldPos = mul(float4(pos, 1), sk_view[input.view_id]);

View file

@ -1,16 +1,14 @@
using StereoKit; using StereoKit;
using System; using System;
using System.Net; using System.Net;
using System.Net.Http;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Speech.Synthesis;
using System.Speech.Recognition;
using System.Speech.AudioFormat;
public class MonoNet { public class MonoNet {
public Mono mono; public Monolith mono;
public MonoNet(Mono mono) { public MonoNet(Monolith mono) {
this.mono = mono; this.mono = mono;
Random rnd = new Random(); Random rnd = new Random();
me = new Peer(rnd.Next(1, 1024 * 8), SolidType.Normal, Color.White); // let the server determine the id me = new Peer(rnd.Next(1, 1024 * 8), SolidType.Normal, Color.White); // let the server determine the id
@ -34,17 +32,6 @@ public class MonoNet {
wData = new byte[bufferSize]; wData = new byte[bufferSize];
peers = new Peer[64]; peers = new Peer[64];
// SpeechSynthesizer synth = new SpeechSynthesizer();
// synth.Speak("oriels!");
// SpeechRecognitionEngine reco = new SpeechRecognitionEngine();
// System.IO.Stream s;
// // s.Write();
// SpeechAudioFormatInfo info = new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, WaveFormatTag.Pcm, 1, 1);
// reco.SetInputToAudioStream(s, info);
Thread.Sleep(1000); // useful? Thread.Sleep(1000); // useful?
Thread readThread = new Thread(Read); Thread readThread = new Thread(Read);
@ -275,19 +262,13 @@ public class MonoNet {
IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint; IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
localIP = endPoint.Address.ToString(); localIP = endPoint.Address.ToString();
} }
publicIP = new WebClient().DownloadString("https://ipv4.icanhazip.com/").TrimEnd(); publicIP = new HttpClient().GetStringAsync("https://ipv4.icanhazip.com/").Result.TrimEnd();
} }
public class Peer { public class Peer {
// to do this we need to assign fixed id's to each peer from the server
// ++ make a peer timeout on the client side as well
public float lastPing; public float lastPing;
public int id; public int id; // on connect: wait on server sending your peer id
public Color color; public Color color;
public Vec3 cursor0, cursor1, cursor2, cursor3; public Vec3 cursor0, cursor1, cursor2, cursor3;
public Pose headset; public Pose headset;

View file

@ -2,23 +2,19 @@ using StereoKit;
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
class Program { SKSettings settings = new SKSettings {
static void Main(string[] args) {
SKSettings settings = new SKSettings {
appName = "oriels", appName = "oriels",
assetsFolder = "Assets", assetsFolder = "add",
depthMode = DepthMode.D32, depthMode = DepthMode.D32,
}; };
if (!SK.Initialize(settings)) if (!SK.Initialize(settings))
Environment.Exit(1); Environment.Exit(1);
// TextStyle style = Text.MakeStyle(Font.FromFile("DMMono-Regular.ttf"), 0.1f, Color.White); // TextStyle style = Text.MakeStyle(Font.FromFile("DMMono-Regular.ttf"), 0.1f, Color.White);
Mono mono = new Mono(); Monolith mono = new Monolith();
mono.Run(); mono.Run();
}
}
public class Mono { public class Monolith {
public Mic mic; public Mic mic;
public Controller domCon, subCon; public bool lefty; public Controller domCon, subCon; public bool lefty;

View file

@ -12,12 +12,12 @@ public abstract class SpatialCursor {
} }
public class Cursors { public class Cursors {
Mono mono; Monolith mono;
public Cursors(Mono mono) { public Cursors(Monolith mono) {
this.mono = mono; this.mono = mono;
} }
SpatialCursor[] oneHanded = new SpatialCursor[] { new ReachCursor(), new TwistCursor() }; int oneIndex = 0; SpatialCursor[] oneHanded = new SpatialCursor[] { new ReachCursor(), new TwistCursor() }; int oneIndex = 0;
SpatialCursor[] twoHanded = new SpatialCursor[] { new StretchCursor(), new CubicFlow(), new SupineCursor() }; int twoIndex = 0; SpatialCursor[] twoHanded = new SpatialCursor[] { new StretchCursor(), new CubicFlow(), new SupineCursor() };
public SpatialCursor Step(Pose domHand, Pose subHand) { public SpatialCursor Step(Pose domHand, Pose subHand) {
SpatialCursor cursor = oneHanded[oneIndex]; SpatialCursor cursor = oneHanded[oneIndex];

View file

@ -8,26 +8,26 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="StereoKit" Version="0.3.5-preview.3" /> <PackageReference Include="StereoKit" Version="0.3.5-preview.3" />
<PackageReference Include="System.Speech" Version="5.0.0" /> <!-- <PackageReference Include="System.Speech" Version="5.0.0" /> -->
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Assets/**"> <None Include="add/**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<!-- <Link>Assets/%(RecursiveDir)%(Filename)%(Extension)</Link> --> <!-- <Link>add/%(RecursiveDir)%(Filename)%(Extension)</Link> -->
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Assets/oriel.hlsl" /> <None Remove="add/oriel.hlsl" />
<None Remove="Assets/crown.hlsl" /> <None Remove="add/crown.hlsl" />
<None Remove="Assets/colorcube.hlsl" /> <None Remove="add/colorcube.hlsl" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<SKShader Include="Assets/oriel.hlsl" /> <SKShader Include="add/oriel.hlsl" />
<SKShader Include="Assets/crown.hlsl" /> <SKShader Include="add/crown.hlsl" />
<SKShader Include="Assets/colorcube.hlsl" /> <SKShader Include="add/colorcube.hlsl" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View file

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View file

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB