'전체 글'에 해당되는 글 68건

  1. 2012.11.28 Perforce Server 유저 자동 생성 막기
  2. 2012.11.28 unrealscript mobile previewer debugging
  3. 2012.11.28 2012년 11월 UDK 릴리즈 노트 중에서.
  4. 2012.11.27 Setting Up Configuration Files for a New Game Project
  5. 2012.04.26 PHP에서 json post 를 처리하는 방법.
  6. 2012.04.26 [C#] HttpWebRequest 클래스를 이용한 POST 전송하기.
  7. 2011.02.04 Fonts for ipad, iphone
  8. 2011.01.07 WPF의 datagrid 의 스타일 정의.
  9. 2011.01.04 PHP 에서 UTF-8 관련 문제.
  10. 2010.12.29 Stencil Routed K-Buffer
  11. 2010.12.26 Tile Map Editor
  12. 2010.12.22 OpentTK/WPF integration
  13. 2010.12.20 ATI Rendermonkey
  14. 2010.12.20 FX Composer 2.5 Sample Projects
  15. 2010.12.17 Integrating XNA 4.0 and WPF
  16. 2010.12.16 SlimDX with WPF (directx10)
  17. 2010.12.16 WPF의 D3DImage 를 가지고 DirectX 사용하기. (4.0)
  18. 2010.08.30 HDK 에서 volume 의 field 이름 지정하기. 3
  19. 2010.08.27 OGRE3D FOR IPHONE 1.7.1
  20. 2010.08.26 OGRE3D for iPhone.

Perforce Server 유저 자동 생성 막기



퍼포스로 서버에 접속시에 유저 생성을 아무나 할 수 있는데 유저 퍼미션을 설정해서 하기도 귀찮으니

제일 먼저 생성된 유저를 어드민으로 만들고 위의 명령을 쳐서 유저 생성을 막으면 된다.


저 명령은 이번에 새로 2012 버젼 p4v 를 실행해서 접속한 뒤 (수퍼 유저) 

File > Open Command Window Here

메뉴를 실행하면 콘솔창이 뜨는데 여기서 p4 커맨드를 날려주면 된다.


그리고 퍼포스 서버 재시작.


unrealscript mobile previewer debugging

nFringe 를 이용한 unrealscript 디버깅 할때 mobile previewer 모드로 실행 해야 하는 경우 (iOS 의 터치를 사용한 경우)




2012년 11월 UDK 릴리즈 노트 중에서.

New Perforce Setup Wizard

  • Developers using the Perforce integration can walk through setting up a new Perforce server via the UDK installer.

Clean Starter Project Tool

  • Developers now have the option to start with a “clean” project with bare minimum code and content upon install.
  • This is a great way to begin development of a new game from scratch!
UDK 를 설치할때만 가능한 것들로서 입력된 프로젝트 이름으로 clean 상태로 인스톨을 한 뒤에 perforce 서버로 자동으로 add 해준다.

현재 설치파일중 한글 부분은 깨져서 메시지가 제대로 나오지 않는다. 씁.

Setting Up Configuration Files for a New Game Project


http://wiki.beyondunreal.com/UE3:Setting_Up_a_New_Game_Project_Tutorial_(UDK)


http://wiki.beyondunreal.com/UE3:Setting_Up_Configuration_Files_for_a_New_Game_Project_Tutorial_(UDK)



UDK 로 새 프로젝트 생성시 추가해야할 것들.




PHP에서 json post 를 처리하는 방법.

How to Handle JSon POST Request Using PHP


http://edwin.baculsoft.com/2011/12/how-to-handle-json-post-request-using-php/


On my last project, i need to create a php service using JSon to handle service requests from multiple clients. My PHP file would consume JSon string for its requests and produce JSon string as its responses.
Im not too familiar with PHP, but after sometime googling i’ve found a workaround. This is how i do it.

01<?php
02// JSon request format is :
03// {"userName":"654321@zzzz.com","password":"12345","emailProvider":"zzzz"}
04 
05// read JSon input
06$data_back = json_decode(file_get_contents('php://input'));
07 
08// set json string to php variables
09$userName = $data_back->{"userName"};
10$password = $data_back->{"password"};
11$emailProvider = $data_back->{"emailProvider"};
12 
13// create json response
14$responses = array();
15for ($i = 0; $i < 10; $i++) {
16    $responses[] = array("name" => $i, "email" => $userName . " " . $password . " " . $emailProvider);
17}
18 
19// JSon response format is :
20// [{"name":"eeee","email":"eee@zzzzz.com"},
21// {"name":"aaaa","email":"aaaaa@zzzzz.com"},{"name":"cccc","email":"bbb@zzzzz.com"}]
22 
23// set header as json
24header("Content-type: application/json");
25 
26// send response
27echo json_encode($responses);
28?>

This is the http header and body of request and response.

Hope it help others, have fun with JSon


지난글에서 C# 으로 post json 데이터를 날리는 경우에는

Content-Type 가 

application/x-www-form-urlencoded 

인 경우에는 $_POST[postData] 로 받아서 처리하면 되는데.


Content-Type 자체가 

application/json

인 경우에는 php 에서 위와 같이 처리한다.

[C#] HttpWebRequest 클래스를 이용한 POST 전송하기.



http://onlybalance.pe.kr/xe/?category=99&mid=tech&document_srl=378&sort_index=readed_count&order_type=desc


[C#] HttpWebRequest 클래스를 이용한 POST 전송하기
01.protected void SendSMS()
02.{
03.String[] messages = new String[6];
04.messages[0] = "행정과";         // 아이디
05.messages[1] = "암호";           // 암호
06.messages[2] = "11111111111";    // 보내는 사람 번호
07.messages[3] = "22222222222";    // 받는 사람 번호
08.messages[4] = "테스트 메시지";  // 메시지
09.messages[5] = "홍길동";         // 받는 사람 이름
10.String postData = String.Format("id={0}&pw={1}&sender={2}&receiver={3}&msg={4}&idreserve={5}", messages[0], messages[1], messages[2], messages[3], messages[4], messages[5]);
11. 
12.HttpWebRequest httpWebRequest = (HttpWebRequest) WebRequest.Create("http://localhost:38080/encoding/encoding.jsp");
13.// 인코딩 1 - UTF-8
14.byte[] sendData = UTF8Encoding.UTF8.GetBytes(postData);
15.httpWebRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
16.// 인코딩 2 - EUC-KR
17.//byte[] sendData = Encoding.GetEncoding("EUC-KR").GetBytes(postData);
18.//httpWebRequest.ContentType = "application/x-www-form-urlencoded; charset=EUC-KR";
19.httpWebRequest.ContentType = "application/x-www-form-urlencoded; charset=utf-8";
20.httpWebRequest.Method = "POST";
21.// Set the content length of the string being posted.
22.httpWebRequest.ContentLength = sendData.Length;
23.Stream requestStream = httpWebRequest.GetRequestStream();
24.requestStream.Write(sendData, 0, sendData.Length);
25.requestStream.Close();
26.HttpWebResponse httpWebResponse = (HttpWebResponse) httpWebRequest.GetResponse();
27.StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream(), Encoding.GetEncoding("EUC-KR"));    // Encoding.GetEncoding("EUC-KR")
28.string html = streamReader.ReadToEnd();
29.streamReader.Close();
30.httpWebResponse.Close();
31. 
32.text.Value = html;
33.}

This is an easy way to make a JSON POST request to a remote service using C#:

1
2
3
4
5
6
7
8
9
10
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/json; charset=utf-8";
DataContractJsonSerializer ser = new DataContractJsonSerializer(data.GetType());
MemoryStream ms = new MemoryStream();
ser.WriteObject(ms, data);
String json = Encoding.UTF8.GetString(ms.ToArray());
StreamWriter writer = new StreamWriter(request.GetRequestStream());
writer.Write(json);
writer.Close();

Notice that in line 4 we create an instance of DataContractJsonSerializer (Assembly: System.ServiceModel.Web) and initialize it with the type of object we are serializing as JSON to send to the service. In lines 5 and 6 the serializer writes the object into a Stream. Line 7 transforms the Stream into an UTF-8 String (as the content-type) and finally in lines 8 to 10 we send the data to the service.


약간의 문제가 발생하게 되는데

x-www-form-urlencoded 방식의 경우에 get 방식의 id=value&id2=value2 같은 방식으로 처리된다. (텍스트로)

그래서 JSON 으로 변환된 문자열을 전송할 경우에 & 문자가 있으면 의도하지 않은 에러가 발생한다.


그래서 serialize 된 문자열에서 


string postData = string.Format("shot={0}", JsonConvert.SerializeObject(shot));

                postData = postData.Replace("&", "%26");

                //string postData = string.Format("shot=TTT", JsonConvert.SerializeObject(shot));

                query_string = "exec=updateshot";

                var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://shots.php?" + query_string);

                httpWebRequest.ContentType = "text/json";

                byte[] sendData = UTF8Encoding.UTF8.GetBytes(postData);

                httpWebRequest.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";              

                httpWebRequest.Method = "POST";

                httpWebRequest.ContentLength = sendData.Length;


                Stream requestStream = httpWebRequest.GetRequestStream();

                requestStream.Write(sendData, 0, sendData.Length);

                requestStream.Close();


                HttpWebResponse httpWebResponse = (HttpWebResponse) httpWebRequest.GetResponse();


                StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream(), Encoding.GetEncoding("UTF-8"));    // Encoding.GetEncoding("EUC-KR")

                string shot_id = streamReader.ReadToEnd();

                streamReader.Close();

                httpWebResponse.Close();


postData = postData.Replace("&", "%26");

처럼 처리해주면 에러를 피할 수 있다.



Fonts for ipad, iphone

http://www.michaelcritz.com/2010/04/02/fonts-for-ipad-iphone/


WPF의 datagrid 의 스타일 정의.


Datagridcell 의 스타일을 정의하는 부분.
이 소스는 원래 cell의 Verticlal alignment 등을 사용하기 위해서 만들었는데 menuitem 도 추가를 했다.
일반적인 사용으로 Click="test" 같은 방식으로 menuitem 을 사용하면 xml 파싱 에러가 발생한다.
Style 정의에서는 이런식으로 사용 할 수 없다. 그래서 위 그림과 같이 event handler 를 사용했다.

'OLD POSTS' 카테고리의 다른 글

[C#] HttpWebRequest 클래스를 이용한 POST 전송하기.  (0) 2012.04.26
Fonts for ipad, iphone  (0) 2011.02.04
PHP 에서 UTF-8 관련 문제.  (0) 2011.01.04
Stencil Routed K-Buffer  (0) 2010.12.29
Tile Map Editor  (0) 2010.12.26

PHP 에서 UTF-8 관련 문제.

기존의 euc-kr 등의 파일들을 UTF-8 로 컨버팅해서 작업을 할 경우에
UTF-8 로 컨버팅된 파일 앞에 BOM 이 붙게 된다.


뭐 unicode 에서는 BOM이 붙는게 정석이긴 한데. 
문제는 php 파일의 맨 앞에 3바이트의 BOM 이 있으면 그 3바이트를 그대로
출력을 한다.

일반 html 에서는 눈에 잘 안띄어서 잘 모를수도 있으나
xmlrpc 서버 같은 경우에도 맨 앞에 붙어서 출력이 되는 바람에
client 에서 제대로 parsing 을 못하는 아주 어이없는 상황이 
계속 발생한다.

php 파일들은 UTF-8 NO BOM 인코딩으로 새로 저장을 다 해주면 해결 할 수 있다.

'OLD POSTS' 카테고리의 다른 글

Fonts for ipad, iphone  (0) 2011.02.04
WPF의 datagrid 의 스타일 정의.  (0) 2011.01.07
Stencil Routed K-Buffer  (0) 2010.12.29
Tile Map Editor  (0) 2010.12.26
OpentTK/WPF integration  (0) 2010.12.22

Stencil Routed K-Buffer

Nvidia direct3D 10 예제중 하나.
잘 봐둬야 할 쉐이더중 하나.

XNA 혹은 DirectX로 한번 새로 구현해 볼만한 것.


'OLD POSTS' 카테고리의 다른 글

WPF의 datagrid 의 스타일 정의.  (0) 2011.01.07
PHP 에서 UTF-8 관련 문제.  (0) 2011.01.04
Tile Map Editor  (0) 2010.12.26
OpentTK/WPF integration  (0) 2010.12.22
ATI Rendermonkey  (0) 2010.12.20

Tile Map Editor


http://www.mapeditor.org/


'OLD POSTS' 카테고리의 다른 글

PHP 에서 UTF-8 관련 문제.  (0) 2011.01.04
Stencil Routed K-Buffer  (0) 2010.12.29
OpentTK/WPF integration  (0) 2010.12.22
ATI Rendermonkey  (0) 2010.12.20
FX Composer 2.5 Sample Projects  (0) 2010.12.20

OpentTK/WPF integration

WPF와 OpenGL 을 통합하는 내용임.
정리가 좀 잘된 편인듯하다.

OpenGL 테스트용으로 이 소스를 가지고 사용하면 좋을듯함.



OpenGL Toolkit for C#

'OLD POSTS' 카테고리의 다른 글

Stencil Routed K-Buffer  (0) 2010.12.29
Tile Map Editor  (0) 2010.12.26
ATI Rendermonkey  (0) 2010.12.20
FX Composer 2.5 Sample Projects  (0) 2010.12.20
Integrating XNA 4.0 and WPF  (0) 2010.12.17

ATI Rendermonkey




개인적으로 nvidia의 fx composer 보다 낫다고 본다.

'OLD POSTS' 카테고리의 다른 글

Tile Map Editor  (0) 2010.12.26
OpentTK/WPF integration  (0) 2010.12.22
FX Composer 2.5 Sample Projects  (0) 2010.12.20
Integrating XNA 4.0 and WPF  (0) 2010.12.17
SlimDX with WPF (directx10)  (0) 2010.12.16

FX Composer 2.5 Sample Projects

샘플 이미지.


'OLD POSTS' 카테고리의 다른 글

OpentTK/WPF integration  (0) 2010.12.22
ATI Rendermonkey  (0) 2010.12.20
Integrating XNA 4.0 and WPF  (0) 2010.12.17
SlimDX with WPF (directx10)  (0) 2010.12.16
WPF의 D3DImage 를 가지고 DirectX 사용하기. (4.0)  (0) 2010.12.16

Integrating XNA 4.0 and WPF

http://blog.bozalina.com/2010/11/xna-40-and-wpf.html



이전에 XNA 3.1 에서 많이 사용하던 방식과는 다른 방식을 취하고 있는데.
일단 XNA Game 의 메인 루프를 XNA Library 형태로 가지고 있고.
각각의 XNA project와 WPF project 에서 그 XNALibrary 를 Add Reference.. 해서
사용한다.

'OLD POSTS' 카테고리의 다른 글

ATI Rendermonkey  (0) 2010.12.20
FX Composer 2.5 Sample Projects  (0) 2010.12.20
SlimDX with WPF (directx10)  (0) 2010.12.16
WPF의 D3DImage 를 가지고 DirectX 사용하기. (4.0)  (0) 2010.12.16
HDK 에서 volume 의 field 이름 지정하기.  (3) 2010.08.30

SlimDX with WPF (directx10)

WPF 4.0 에서 slimdx 를 함께 사용하기.
slimdx 의 샘플 디렉토리에 포함되어있음.





WPF의 D3DImage 를 가지고 DirectX 사용하기. (4.0)



http://www.codeproject.com/KB/WPF/D3DImage.aspx

위의 샘플을 바로 4.0에서 컴파일해서 실행하면 에러가 발생하는데.
원래 있는 wpf project 를 지우고 새로만들어서 컴파일 한 프로젝트.

dll 파일과의 통신 등등이 주요 포인트.

http://www.mediafire.com/?ww9dzoaq2389j9d

'OLD POSTS' 카테고리의 다른 글

Integrating XNA 4.0 and WPF  (0) 2010.12.17
SlimDX with WPF (directx10)  (0) 2010.12.16
HDK 에서 volume 의 field 이름 지정하기.  (3) 2010.08.30
OGRE3D FOR IPHONE 1.7.1  (0) 2010.08.27
OGRE3D for iPhone.  (0) 2010.08.26

HDK 에서 volume 의 field 이름 지정하기.

HDK 에서 volume data의 field 이름을 지정할려면..

GEO_AttributeHandle attributeHandle;
int def = -1;

gdp->addPrimAttrib("name", sizeof(int), GB_ATTRIB_INDEX, &def);
attributeHandle = gdp->getPrimAttribute("name");
// Set the name of the primitive
attributeHandle.setElement(volumeGdp);
attributeHandle.setString(cellDataName);

먼저 primattrib를 name 하나 만들어주고...
attributeHandle에서 setString 을 가지고 field 이름을 만들어준다.

이름에 .x .y .z 값을 뒤에 붙여주게 되면 후디니가 알아서 parsing 해서 vector field 로 만들어준다.
(기본적으로 후디니에서 vector3 값을 저장하는 볼륨은 없는 듯함)

만트라와 후디니는 기본적으로 velocity 값은 vel.x vel.y vel.z 의 볼륨 field name 으로 가져온다.

The common convention in Houdini is to use the index geometry primitive attribute "name" to store semantic information about the meaning of the volume. The convention is to use .x, .y, and .z to identify the respective components of vector volumes such as velocity fields. Thus the three primitive volumes vel.xvel.y, and vel.z will be grouped by Mantra and Houdini into a logical vector-valued volume named vel. SOP group fields can use @name=vel.* to select only the velocity primitive volumes.


* setElement 로 primitive 를 지정한뒤.
  setString 으로 "name" attribute 의 값을 string 으로 지정한다. ==> 이게 결론.

'OLD POSTS' 카테고리의 다른 글

SlimDX with WPF (directx10)  (0) 2010.12.16
WPF의 D3DImage 를 가지고 DirectX 사용하기. (4.0)  (0) 2010.12.16
OGRE3D FOR IPHONE 1.7.1  (0) 2010.08.27
OGRE3D for iPhone.  (0) 2010.08.26
Python Expression For Nuke.  (0) 2010.07.20

OGRE3D FOR IPHONE 1.7.1

http://sourceforge.net/projects/ogre/files/

위의 링크로 가서 파일을 받아서 컴파일 하면 되는데.
몇가지 주의할 점들이 있다.

iPhonedependencies 를 받아야 하는데.
ogre 소스를 받아서 컴파일을 하든 ogreSDK를 받든지 간에
일단 무조건 컴파일을 해야 한다. 아마도 iOS4 SDK 의 버젼 문제 등등의 이유인것 같다.
(ogreSDK 는 xcode project가 포함되어 있다. 이걸 열어보면 아마도 iphone SDK 3.0 으로 되어있을것이다.
 그래서 일단 개발용 맥에 맞는 버젼으로 컴파일을 해줘야 할것이다.)

일단 ogre 소스를 컴파일 할때는 cmake 에서 OGRE_BUILD_PLATFORM_IPHONE=1 이라는 옵션을 줘서
xcodeproject 파일을 생성해서 그 파일을 열고 컴파일을 하면 되는데. cmake 는 무조건 2.8.0 버젼을 써야한다.
2.8.1 이상의 버젼에서는 xcode project가 제대로 만들어지지 않아서 프로젝트 파일을 열수가 없다.

ogreSDK 를 다운 받았다면 그 안의 xcode project 를 열어서 컴파일을 해주면 되는데.

위의 두가지 상황에서 공통적으로 해야할것들이 iPhonedependencies 를 다운 받아서 폴더에 복사를 하는것이다.
여기엔 boost 라든가 기타등등 몇가지 필요한 라이브러리들을 포함하고 있는데. 이것도 안에 보면 xcode project 파일이
있다. 이걸 열어서 해당 iOS 버젼에 맞게 맞춰준후에 컴파일을 해줘야 한다.
그래야 라이브러리 파일들이 iOS SDK의 파일들과 링크가 제대로된다.
만약 테스트 프로젝트 를 만들었는데 컴파일은 되는데 링크에서 에러가 발생할 경우에는 로그를 살펴보면
문제가 생긴 라이브러리 파일들이 있을 것이다. 그 부분을 현재 iOS SDK 버젼에 맞게 재컴파일 해주면 많은 부분
해결할 수 있을 것이다.

OGRE3D for iPhone.

1.7.0 버젼 부터인가 아이폰을 지원하기 시작했다.

테스트삼아 아이폰에서 돌릴려고 이틀간 삽질하던중.
xcodeproj 가 전혀 읽어지지가 않는 것이다..
그래서 여기저기 찾아본 결과 실마리가 cmake 버젼이 2.8.0 이라면 될것이다!? 라는 것이다.

그래서 cmake 2.8.0 버젼을 설치하기 위해서 port install cmake @2.8.0 등등 별 짓을 했으나.

macports 에서는 방법이 없는듯하다.

그래서 결국 홈페이지에서 찾아서 깔았다. 씁..

http://www.cmake.org/files/v2.8


prev 1 2 3 4 next