在学习OSG提供的例子osgCamera中,由于例子很长,涉及很多细节,考虑将其分解为几个小例子.本文介绍实现在一个窗口中添加多个相机的功能. 此函数接受一个Viewer引用类型参数,设置图形上下文的特征变量traits,并由它建立图形上下文.根据需要差创建的相机数量,循环创建相机变量,并将其添加到观察器变量中,作为从相机.每次创建相机,都需要获取当前图形上下文,并设置相机的起点(左下角)坐标和相机的宽度与高度.相机间的区别仅在于相机起点的不同.完整的程序代码如下. void singleWin…
这个例子演示了在多个窗口中创建多个相机,函数的代码如下: void multiWindowMultipleCameras(osgViewer::Viewer& viewer,bool multipleScreens) { osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); if (!wsi) { osg::notify(osg::NOT…
我们都知道window.open(url)是最基本的用法,很多人都在url里用?xx=11&yy=22的方式拼接参数,但是其实我们不愿意让使用者看到后面的参数,这时我们可以如下方法 JS如下: var new_win=window.open("",winName,"height="+height+",width ="+width+",top="+(window.screen.height-height)/2+"…
下载linux 服务器上的文件 down.php 格式为  pscp linux服务器上用户名@linux 服务器ip  文件在windows系统上的绝对路径 如果是下载服务器上的某个目录,只要在pscp 后加个-r参数,格式为: pscp -r linux服务器上用户名@linux 服务器ip  文件在windows系统上的绝对路径…
Learning OSG programing---osgScribe Scribe可以翻译为素描,抄写等.本例通过在模型表面添加一层素描,来显示模型的骨架. 关键代码: osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet; osg::ref_ptr<osg::PolygonOffset> polyoffset = new osg::PolygonOffset; polyoffset->setFactor(-1.0…
1.鼠标进入容器方向的判定 判断鼠标从哪个方向进入元素容器是一个经常碰到的问题,如何来判断呢?首先想到的是:获取鼠标的位置,然后经过一大堆的if..else逻辑来确定.这样的做法比较繁琐,下面介绍两种比较方便的方法: 第一种方法,利用圆和反正切三角函数 如下图所示: 以div容器的中心点作为圆心,以高和宽的最小值作为直径画圆,将圆以[π/4,3π/4),[3π/4,5π/4),[5π/4,7π/4),[-π/4,π/4)划分为四个象限. 代码如下: $(".box").on("…
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. For example,Given nums…
nw.js FrameLess Window下的窗口拖拽与窗口大小控制 很多时候,我们觉得系统的Frame框很难看,于是想自定义. 自定义Frame的第一步是在package.config文件中将frame选项设置为false. { "name": "1", "main": "index.html", "nodejs": true, "single-instance": false, &…
文件传输协议 (FTP) 是一个标准协议,可用来通过 Internet 将文件从一台计算机移到另一台计算机. 这些文件存储在运行 FTP 服务器软件的服务器计算机上. 然后,远程计算机可以使用 FTP 建立连接,并从服务器读取文件或将文件复制到服务器. FTP 服务器与 HTTP 服务器(即 Web 服务器)的相似之处在于可以使用 Internet 协议与之通信. 但是,FTP 服务器不运行网页:它只是向/从远程计算机发送/接收文件. 可以将 Internet 信息服务 (IIS) 配置为作为…
一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { var IsIE = (navigator.appName == 'Microsoft Internet Explorer') if(IsIE) {//如果是IE alert(document.frames(ObjectID).document.getElementById(ContentID).i…
javascript 父窗口与子窗口的互相调用 <html> <head></head> <body> 主要实现父子关系的页面 window.opener 是window.open 打开的子页面调用父页面对象 a.html <title>主页面</title> <script type="text/javascript"> /** 为测试IFrame子窗口调用父窗口的全局变量而添加的测试变量 */ va…
一.Iframe 篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&& //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValu…
父窗口 创建一个窗口 var backinfo = window.showModalDialog('UserSelect.aspx', '', 'dialogHeight=600px; dialogWidth= 600px; edge=Raised; center=Yes;resizable= No; status= no;help=no'); 子窗口 调用JS关闭自身并返回值 function SelectCompany(obj) {                            wi…
<!--实例001使用window对象打开窗口--> <script> <!--使用window对象打开窗口的语法格式如下--> <!--window.open(url,windowname,location);--> // location:对窗口属性进行设置,可选参数如下: // width, // height, // scrollbars(是否显示滚动条), // resizable(设定窗口大小是否固定), // toolbar(浏览器工具条,包括…
未完整版 javascript 父窗口与子窗口的互相调用 a.html 父页面 <HTML> <HEAD> <meta http-equiv="content-Type" content="text/html;charset=utf-8"> <TITLE></TITLE> <style></style> <script type="text/javascript&qu…
window.onfocus = function(){ // 窗口获取焦点事件}; window.onblur= function(){ // 窗口失去焦点事件};有弊端,亲测. 所以我还有一个更好的办法,就是监听页面是否在当前,而不是最小化或离开了. document.addEventListener('visibilitychange', () => { if (!document.hidden) { // 我回来了. }}); 2018年12月7日:补充,有兼容问题.于是我找到了这个兼容…
http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&a…
$().ready().$(handler).$(document).ready(handler)均不是原生JS中的,都是jQuery中封装的方法.这些事件在当页面的dom节点加载完毕后就执行,无需等待页面中的图片等加载完成.DomContentLoaded是原生的表示在Dom节点加载完毕之后就执行该事件. window.onload()以及body中的onload()两者都表示当页面加载元素(包括图片等信息)完毕后执行的操作,是原始JS中就有的.同时window.onload只能注册一个事件处…
js中window.onload 与 jquery中$(document.ready())差别,验证代码例如以下(调换js代码和Jquer代码书写顺序測试.执行结果一样.因此与代码书写位置没关系): <html> <head> <script type='text/javascript' src='jquery-1.11.1.min.js'></script> <script type='text/javascript'> $(document)…
通过Window.DataContext实现窗口之间的传值,特别是跨窗口控件的联动,具有无可比拟的优势.实现方法如下: 1.  MainWindow.xaml,在Window.DataContext中声明Binding,Binding的源是窗口的控件 <Window x:Class="WpfAppInterWindow.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation…
2011年09月29日 23:47:46 阅读数:7269 Qt 4.0 automatically double-buffers Qt 4.1 QWidget::autoFillBackground Qt 4.2 delayed widget creation (DWC) stylesheet Qt 4.3 QWidget::render Qt 4.4 Alien Widget Qt 4.5 Translucent Windows Qt 4.6 widget's graphics effect…
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding…
Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequenceof W. If there is no such window in S that covers all characters in T, return the empty string "". If there are multiple such minimum-length windows…
打开新窗口(window.open) open() 方法可以查找一个已经存在或者新建的浏览器窗口. 语法: window.open([URL], [窗口名称], [参数字符串]) 参数说明: URL:可选参数,在窗口中要显示网页的网址或路径.如果省略这个参数,或者它的值是空字符串,那么窗口就不显示任何文档. 窗口名称:可选参数,被打开窗口的名称. 1.该名称由字母.数字和下划线字符组成. 2."_top"."_blank"."_selft"具有特…
/* OpenSceneGraph example, osgwindows. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, includ…
接下来是用createModel函数创建模型: osg::ref_ptr<osg::Group> createModel(bool overlay, osgSim::OverlayNode::OverlayTechnique technique) { osg::Vec3 center(0.0f,0.0f,0.0f); float radius = 100.0f; osg::ref_ptr<osg::Group> root = new osg::Group; float baseHe…
osg::Node* createBase(const osg::Vec3& center,float radius) { ; ; *radius; *radius; osg::Vec3 v000(center - osg::Vec3(width*0.5f,height*0.5f,0.0f)); osg::Vec3 dx(osg::Vec3(width/((float)numTilesX),0.0,0.0f)); osg::Vec3 dy(osg::Vec3(0.0f,height/((floa…
osg::AnimationPath* createAnimationPath(const osg::Vec3& center,float radius,double looptime) { // set up the animation path osg::AnimationPath* animationPath = new osg::AnimationPath; animationPath->setLoopMode(osg::AnimationPath::LOOP); ; float y…
本例示范了osg中Shape ---- 基本几何元素的绘制过程.参照osg官方文档,Shape 类包含以下子类: 在示例程序中,函数createShapes函数用于生成需要绘制的几何形状. osg::Geode* createShapes(osg::ArgumentParser& arguments) { osg::Geode* geode = new osg::Geode(); // --------------------------------------- // Set up a Sta…
OSG Clip例程剖析 首先是创建剪切节点的函数代码: osg::ref_ptr<osg::Node> decorate_with_clip_node(const osg::ref_ptr<osg::Node>& subgraph) { osg::ref_ptr<osg::Group> rootnode = new osg::Group; // create wireframe view of the model so the user can see //…